Module not found error during build after upgrading to next@12
See original GitHub issueWhat version of Next.js are you using?
12.0.1
What version of Node.js are you using?
14.16.0
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
After upgrading from next@11.1.2 to next@12.0.1 I’m getting the following error during build
Module not found: Can't resolve 'isarray'
The library in question is swagger-ui-react so I’m not 100% sure if the problem lies within next@12 or swagger-ui-react but the problem only appears when using next@>=12.0.0
Expected Behavior
When upgrading to next@>=12.0.0 there is not a module not found error while building
To Reproduce
Here are a couple stack blitz reproductions (must be run using chrome)
next@11.1.2 + swagger-ui-react@3.52.5 => WORKING
next@12.0.1 + swagger-ui-react@3.52.5 => BROKEN
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
module-not-found - Next.js
A module not found error can occur for many different reasons: The module you're trying to import is not installed in your dependencies;...
Read more >NextJS12 production build errors on module not found
I don't think this is an actual error. This happened to me once. Just try deleting .next folder first and then run npm...
Read more >Next.js + Webpack - Fix for ModuleNotFoundError: Module not ...
To fix the error with Webpack 4, update your Next.js config file ( /next.config.js ) with the following, it tells webpack to set...
Read more >Upgrade Guide (v4) - NextAuth.js
We no longer have a default export in next-auth/jwt . ... Introduced in https://github.com/nextauthjs/next-auth/releases/tag/v4.0.0-next.12 ...
Read more >Next.js 12 - 5 Changes You Should Pay Close Attention To ...
ES modules also run in the “strict” mode, outputting some smaller errors that otherwise JavaScript would not mind. When using CommonJS modules, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing in favor of https://github.com/swagger-api/swagger-ui/issues/7650 as this does appear to be a bug in swagger-ui as they are using a dependency not listed in their
package.json
which isn’t valid. This worked accidentally previously in Next.js since the dependency was shared but could have broken at any point.@balazsorban44 confirmed this is still a problem using next@12.0.7 + swagger-ui-react@4.1.3
Updated StackBlitz showing problem here (must be viewed using chrome)