-
Notifications
You must be signed in to change notification settings - Fork 26.3k
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
next build fails with ERR_MODULE_NOT_FOUND - Works in 11.x but not in 12.x #31974
Comments
next build
fails with ERR_MODULE_NOT_FOUND - Works in 11.x but not in 12.x
next build
fails with ERR_MODULE_NOT_FOUND - Works in 11.x but not in 12.xnext build
fails with ERR_MODULE_NOT_FOUND - Works in 11.x but not in 12.x
next build
fails with ERR_MODULE_NOT_FOUND - Works in 11.x but not in 12.x
Adding this to experimental: {
esmExternals: false,
}, Fixes this temporarily. Seems to be related to https://nextjs.org/blog/next-12#es-modules-support-and-url-imports I'll try to look more into this. Here is a related thread: #27876 |
Thanks @balazsorban44 for the info and links. |
I looked at the module that is failing. Adding Might be because of: https://nodejs.org/api/esm.html#mandatory-file-extensions In that case, maybe that dependency is packaged incorrectly and Next.js was good at masking the issue in previous versions but is more strict about it in newer ones? 🤔 |
So yes. My assumption seems to be correct. This applies: https://nodejs.org/api/esm.html#mandatory-file-extensions Next.js 12 defaults This means you will have to take it up with the |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
12.0.4
What version of Node.js are you using?
17.0.1
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
next build
Describe the Bug
next build
erros with a Module not foundExpected Behavior
A proper successful build.
To Reproduce
I created a repo with 2 branches and steps.
next 11.x branch : Building correctly
next 12.x branch : Building fails
https://github.com/lionelhorn/issues-nextjs-deepkit
The text was updated successfully, but these errors were encountered: