New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating from 12.1.4 to 12.1.5: Error: Cannot find module 'next/dist/shared/lib/router/utils/routing-items.js' #36234
Comments
OK - I was able to fix this issue by deleting ~/.next. Seems like a build cache bug. Latest version removed routing-items.js but cached build files still require it? |
+1 this fixed it for me, thanks. |
Did you upgrade Next.js while running the app and didn't reboot after upgrading? Just trying to figure out how to reproduce this. |
I'm not sure whether Next.js was running during the npm install. But afterwards, restarting with |
That's quite unexpected as the Next.js version is part of the cache key which would mean that any up/downgrade would invalidate the cache. |
Had the same issue and this fixed for me as well 👍 |
It's happened again upon upgrading to 12.1.6 Error: Cannot find module 'next/dist/server/denormalize-page-path.js' This time I've backed up the problematic ~/.next folder. Let me know if I can help provide additional debugging. |
I'm getting the same error. |
This will most likely be fixed in #36666, just published a new canary version that has that PR: https://github.com/vercel/next.js/releases/tag/v12.1.7-canary.3 |
I had the same error. But for me it was due to having |
Similar to @Alexolo ... Resolved by changing And then deleting node_modules and |
Simply deleting the .next folder and running the server afresh("pnpm run dev") resolved the issue for me. |
I was also getting a similar error message:
I tried downgrading
To note when I opened localhost:3000 I would get the error message: So, I deleted EDIT: When I ran EDIT EDIT:: So, I think it is an issue with my cache. I cloned the repo and after running |
I have the error that @Isaac-Tait mentionned I'm using next: 12.3.0 and it is only when in production mode that the error triggers (In a Docker container, so no errors with EDIT: Upgrading to 12.3.1 fixed the issue for me |
@davidye I am facing same error as you mentioned : |
Thanks, man this saved a life! |
Appears as if the new raw blitz app is broken. I am unable to get it working even after deleting .next and node modules folders |
Getting this issue when deployed to AWS elastic Beanstalk:
On my local PC Next version: |
Same issue here, didn't have any ~/.next folder, delete .next in project root didn't help. |
Getting this issue when brand new project generated by |
I had the same issue running |
i changed it to |
Closing this since there is no |
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. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
After updating from 12.1.4 => 12.1.5 (and 12.1.6-canary.3) I get this build error. Downgrading back to 12.1.4 resolves the issue.
node:internal/modules/cjs/loader:933
const err = new Error(message);
^
Error: Cannot find module 'next/dist/shared/lib/router/utils/routing-items.js'
Require stack:
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.mod._resolveFilename (/Users/me/hello/client/node_modules/next/dist/build/webpack/require-hook.js:183:28)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object../utils/routing-items (/Users/me/hello/client/.next/server/pages/_app.js:1229:18)
at webpack_require (/Users/me/hello/client/.next/server/webpack-runtime.js:33:42)
at eval (webpack-internal:///./node_modules/next/dist/shared/lib/router/router.js:45:21)
at Object../node_modules/next/dist/shared/lib/router/router.js (/Users/me/hello/client/.next/server/pages/_app.js:99:1)
at webpack_require (/Users/me/hello/client/.next/server/webpack-runtime.js:33:42) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/me/hello/client/.next/server/pages/_app.js',
'/Users/me/hello/client/node_modules/next/dist/server/require.js',
'/Users/me/hello/client/node_modules/next/dist/server/load-components.js',
'/Users/me/hello/client/node_modules/next/dist/build/utils.js',
'/Users/me/hello/client/node_modules/next/dist/build/output/store.js',
'/Users/me/hello/client/node_modules/next/dist/build/output/index.js',
'/Users/me/hello/client/node_modules/next/dist/cli/next-dev.js',
'/Users/me/hello/client/node_modules/next/dist/bin/next'
]
}
Expected Behavior
Build correctly
To Reproduce
See stack trace, 'next/dist/shared/lib/router/utils/routing-items.js' is missing from node_modules.
The text was updated successfully, but these errors were encountered: