question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found error during build after upgrading to next@12

See original GitHub issue

What 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ijjkcommented, Feb 3, 2022

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.

1reaction
trentprynncommented, Dec 24, 2021

@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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found