You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above code produces the error below with a 500 error that breaks the application
⨯ node:path
Module build failed: UnhandledSchemeError: Reading from "node:path" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
Import trace for requested module:
node:path
GET /_next/static/webpack/adfdf801ae66cabf.webpack.hot-update.json 500 in 37ms
Provide environment information
Operating System:
Mac Os
Environment:
Node: v22.13.1
pnpm: 10.7.0
Packages
"next": "15.3.0-canary.33"
next.config.ts
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
experimental: {
nodeMiddleware: true,
},
};export default nextConfig;
Which area(s) are affected? (Select all that apply)
Middleware
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
Tested with other lower versions of the Next.js canary, but the issue persisted in all cases
The text was updated successfully, but these errors were encountered:
Link to the code that reproduces this issue
https://github.com/Eprince-hub/test-middleware
To Reproduce
git clone https://github.com/Eprince-hub/test-middleware
pnpm i
pnpm dev
Current vs. Expected behavior
According to this release blog post on the latest Next.js canary version (https://nextjs.org/blog/next-15-2#nodejs-middleware-experimental), the Next.js middleware, AKA middleware.ts, is supposed to work without issues when using Node.js native modules.
So this code below should work but that is not the case.
The above code produces the error below with a 500 error that breaks the application
Provide environment information
Which area(s) are affected? (Select all that apply)
Middleware
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
Tested with other lower versions of the Next.js canary, but the issue persisted in all cases
The text was updated successfully, but these errors were encountered: