next.js: Next.js 8.1 has broken build: The "original" argument must be of type function
Bug report
Describe the bug
Since upgrading my version of next from 8.0.4 to 8.1, the next build command no longer works and the following is outputted:
“(node:1055) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError [ERR_INVALID_ARG_TYPE]: The “original” argument must be of type function (node:1055) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.”
Can confirm that this is a new bug, as downgrading next version back to 8.0.4 resolves the issue. The issue is not only present in my apps, but also the examples.
To Reproduce
- Clone the next.js repo.
- Change directory to
/examples/custom-server. npm i.next run build.
And you’ll end up with the above error.
Expected behavior
A production-optimised build of the app is generated.
System information
- OS: macOS
- Version of Next.js: 8.1
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 5
- Comments: 18 (15 by maintainers)
Commits related to this issue
- Remove selectivePageBuilding check before using AllModulesIdentifiedPlugin Fixes #7109 — committed to stovmascript/next.js by stovmascript 8 years ago
- Always use AllModulesIdentifiedPlugin after HashedModuleIdsPlugin Remove selectivePageBuilding check during build. Fixes #7109 — committed to stovmascript/next.js by stovmascript 8 years ago
- Always use AllModulesIdentifiedPlugin after HashedModuleIdsPlugin (#7138) Remove selectivePageBuilding check during build. Fixes #7109 — committed to vercel/next.js by stovmascript 8 years ago
I have the ~same~ problem. What is your node version @LoicVerrall? I’m running v11.10.0.
Edit: Actually my error is different, but the outcome is the same:
Excellent @stovmascript, can you send a PR removing that switch from the plugin? 🙏
@stovmascript actually, can you hand edit your
node_modules/next/dist/build/webpack-config.jsand find this line:and change it to:
And report back if that fixes it? Thanks!
@MarchWorks I also tested on v10.10.0, but no go.
I think the examples are working because they don’t generate chunks that have ids which are just numbers.
shouldn’t you use the stable version of node
v10.15.3it’s the one that I used