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
Add middleware.ts (warning is present whether there is any code in the middleware() function or not)
npm run build
Observe warning
NOTE: subsequent builds will not show the warning but if you delete .next/ and build again it will show the warning
Current vs. Expected behavior
Results in an unexpected warning during build:
⚠ Compiled with warnings
./node_modules/.pnpm/next@14.0.0_@babel+core@7.22.6_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/esm/shared/lib/router/utils/app-paths.js
A Node.js module is loaded ('url' at line 3) which is not supported in the Edge Runtime.
Verify canary release
I verified that the issue exists in the latest Next.js canary release
./node_modules/.pnpm/next@14.0.0_@babel+core@7.22.8_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/esm/shared/lib/router/utils/app-paths.js
A Node.js module is loaded ('url' at line 3) which is not supported in the Edge Runtime.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/frasergr/url-edge-warning-next14
To Reproduce
npx create-next-app@latest
middleware.ts
(warning is present whether there is any code in themiddleware()
function or not)npm run build
NOTE: subsequent builds will not show the warning but if you delete
.next/
and build again it will show the warningCurrent vs. Expected behavior
Results in an unexpected warning during build:
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 Binaries: Node: 18.17.1 npm: 9.6.7 Yarn: N/A pnpm: 8.6.12 Relevant Packages: next: 14.0.0 eslint-config-next: 14.0.0 react: 18.2.0 react-dom: 18.2.0 typescript: 5.2.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
App Router, Middleware / Edge (API routes, runtime)
Additional context
The warning appeared in next@13.5.7-canary.24
The text was updated successfully, but these errors were encountered: