Next.js 8.1 has broken build: The "original" argument must be of type function
See original GitHub issueBug 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
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:18 (15 by maintainers)

Top Related StackOverflow Question
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? 🙏