mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
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()
|
|
}
|