Files
Hendrik Liebau 5bd025d4c4 Do not warn during build for supported modules in the Edge runtime (#74752)
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.
2025-01-10 18:43:28 +01:00

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()
}