createLogger(request) to access it)next-on-pages, but does Middleware have some way of passing data around?
⨯ Error: Cannot find module 'node:async_hooks'
createLogger(request) ⨯ Error: Cannot find module 'node:async_hooks'page:build: ▲ Failed to compile.
page:build: ▲ node:async_hooks
page:build: ▲ Module build failed: UnhandledSchemeError: Reading from "node:async_hooks" is not handled by plugins (Unhandled scheme).
page:build: ▲ Webpack supports "data:" and "file:" URIs by default.
page:build: ▲ You may need an additional plugin to handle "node:" URIs.export function middleware(request: NextRequest) {
const rayId =
request.headers.get("CF-Ray") ??
Math.floor(Math.random() * 10000).toString();
return als.run(rayId, () => NextResponse.next());
}config.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp: /^node:async_hooks$/,
}),
);