mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
5bd025d4c4
When using a Node.js module that is [supported in the Edge runtime](https://vercel.com/docs/functions/runtimes/edge-runtime#compatible-node.js-modules), we must not emit a warning during build.
11 lines
267 B
TypeScript
11 lines
267 B
TypeScript
import { NextResponse, NextRequest } from 'next/server'
|
|
import { AsyncLocalStorage } from 'async_hooks'
|
|
|
|
const storage = new AsyncLocalStorage<{}>()
|
|
|
|
export async function middleware(request: NextRequest) {
|
|
storage.run({}, () => {})
|
|
|
|
return NextResponse.next()
|
|
}
|