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.

Can no longer build with `9.3.4`

See original GitHub issue

Bug report

Describe the bug

After upgrading to 9.3.4, next build errors with:

❯ npm run build

> my-project@1.0.0 build /dev/my-project
> cross-env NEXT_TELEMETRY_DISABLED=1 next build

Creating an optimized production build  

Failed to compile.

./node_modules/next/dist/client/next.js
TypeError: invalid options argument
    at new Promise (<anonymous>)
    at Generator.throw (<anonymous>)


> Build error occurred
Error: > Build failed because of webpack errors
    at build (/dev/my-project/node_modules/next/dist/build/index.js:13:900)

I noticed that, for some reason, the actual line in which the error is thrown varies between runs of next build, seemingly at random. However, the error message is always the same.

For example:

Failed to compile.

./node_modules/next/dist/client/polyfills.js
TypeError: invalid options argument
Failed to compile.

./node_modules/next/dist/client/router.js
TypeError: invalid options argument

Expected behavior

Project builds correctly.

System information

  • OS: macOS Catalina 10.15.4 (19E266)
  • Version of Next.js: 9.3.4
  • Version of node: v12.16.1

Additional context

No other modifications were done or applied. All other dependencies remain the same in lockfile.

Reverting back to 9.3.3 solves the issue for me.

❯ npm remove next && npm i next@9.3.3

+ next@9.3.3
added 656 packages from 270 contributors and audited 1063442 packages in 27.174s

77 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

❯ npm run build

> my-project@1.0.0 build /dev/my-project
> cross-env NEXT_TELEMETRY_DISABLED=1 next build

Creating an optimized production build  

Compiled successfully.

Automatically optimizing pages  


# ...

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:17
  • Comments:43 (18 by maintainers)

github_iconTop GitHub Comments

8reactions
mattcarlottacommented, Apr 3, 2020

@timneutkens I believe I tracked down the issue to the mkdirp dependency. Specifically, how npm’s registry resolves the mkdirp dependency to this repo, while the yarn registry resolves mkdirp dependency to this repo. Swapping out the npm registry version (v1.0.3) for the yarn locked registry version (v0.5.4) seems to have fixed the issue.

Perhaps providing a package.lock.json in addition to the yarn.lock may solve this problem or perhaps adding mkdirp@0.5.4 to next’s package.json devDependencies. Let me know how you wish to proceed. I can create a pull request if needed.

Working example (use npm i or yarn, both should compile without errors): https://github.com/mattcarlotta/next-9.3.4-reproduction

It appears, in andrew’s case, that the apollo package requires mkdir: "^1.0.3", while every other package, requires mkdirp "^0.5.0": T7yQa5F

8reactions
jundialwancommented, Apr 2, 2020

I do face the same problem with 9.3.4 but with different error message, see below. Version 9.3.3 do me just fine.

> next build

Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected.
See here for more info: https://err.sh/next.js/built-in-css-disabled

Creating an optimized production build  

Failed to compile.

./src/pages/login.js
Error: Cannot find module 'find-cache-dir'


> Build error occurred
Error: > Build failed because of webpack errors
    at build ([XXXXXXXXXX]/node_modules/next/dist/build/index.js:13:900)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@1.0.15 build: `next build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the my-app@1.0.15 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     [XXXXXXXX]/.npm/_logs/2020-04-02T11_52_50_720Z-debug.log
Error: > Build failed because of webpack errors
  at build ([XXXXXXXXXX]/node_modules/next/dist/build/index.js:13:900)

^ This part precisely same as @howks @nfantone problem above

Read more comments on GitHub >

github_iconTop Results From Across the Web

iPad update from 9.3.2 to 9.3.4 - Apple Community
I tried updating and restoring, but was told this build could not be installed ... An exception would be if the device no...
Read more >
drupal 9.3.4
Learn more about Drupal 9. Drupal 9.3.x will receive security coverage until December 2022. If you are upgrading from Drupal 8, ...
Read more >
NO iOS 9.3.4 Update & Remove Cydia! (NO COMPUTER)
iOS 9.3.3 Remove Jailbreak WITHOUT Updating iOS 9.3.4 ! How to UnJailbreak 9.3.3 & Remove ... Your browser can ' t play this...
Read more >
Cisco Nexus 9000 Series NX-OS Release Notes, Release 9.3(4)
Symptoms: Some N9K-C9332C ports can't come up while using QSA with 10G-LR. Transceiver could receive light, but interface is down. Workarounds: ...
Read more >
iOS 9.3.4 Released as Important Security Update [IPSW ...
Additionally some users trying to install iOS 9.3.4 may encounter an “This Device isn't Eligible for the Requested Build” error message, ...
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