turbo
turbo copied to clipboard
[turborepo] Document Node 16 Min Requirement and Fail on using less than node 16
What version of Turborepo are you using?
Alpha
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Windows
Describe the Bug
If you accidentally use a version less than node 16 for the new turbopack demo you get some confusing error messages.
event - initial compilation 6.668ms
\\?\C:\Users\selarkin\Code\turbopack-demo\turbopack-demo\.next\server\app\chunks\ssr\node_modules_next_dist_f441f7.js:12539
this[r][E] ??= new Map([
^^^
SyntaxError: Unexpected token '??='
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (\\?\C:\Users\selarkin\Code\turbopack-demo\turbopack-demo\.next\server\app\index.js:8:1)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47
Expected Behavior
Just fail or error out on non-support node version so unhelpful error messages don't surface to users.
To Reproduce
Follow the steps to install turbopack quickstart:
https://turbo.build/pack/docs#quickstart
Reproduction Repo
https://turbo.build/pack/docs#quickstart
Just to clarify @mehulkar the tool should in addition to having docs about its minimum supported node version, also fail if the minimum supported node version is not used.
Some of the example monorepos use tsup
, which currently requires Node >= v18.
My project was failing completely to start with Turbopack
using Node v16
.
I was getting:
failed to convert header to a str
Debug info:
- Execution of resolve_source_request failed
- failed to convert header to a str
With v18.16.0
works fine.
Next.js requires Node.js 18 on the latest version so this issue is no longer relevant. Going to close it 🙏 Thanks for the report!