Turbopack: Add a check for node version before allowing workerThreads#91614
Turbopack: Add a check for node version before allowing workerThreads#91614
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Notifying the following users due to files changed in this PR based on this repo's notify modifiers: @timneutkens, @ijjk, @shuding, @huozhi: |
Failing test suitesCommit: 5a467fe | About building and testing Next.js
Expand output● non-root-project-monorepo › monorepo-package › should work during RSC ● non-root-project-monorepo › monorepo-package › should work during SSR ● non-root-project-monorepo › monorepo-package › should work on client-side ● non-root-project-monorepo › import.meta.url › should work during RSC ● non-root-project-monorepo › import.meta.url › should work during SSR ● non-root-project-monorepo › import.meta.url › should work on client-side
Expand output● upward-distdir › should work
Expand output● filesystem-caching with cache disabled › should cache or not cache loaders ● filesystem-caching with cache disabled › should cache or not cache loaders ● filesystem-caching with cache disabled › should cache or not cache loaders ● filesystem-caching with cache disabled › should allow to change files while stopped (RSC change) ● filesystem-caching with cache disabled › should allow to change files while stopped (RSC change) ● filesystem-caching with cache disabled › should allow to change files while stopped (RSC change) ● filesystem-caching with cache disabled › should allow to change files while stopped (RCC change) ● filesystem-caching with cache disabled › should allow to change files while stopped (RCC change) ● filesystem-caching with cache disabled › should allow to change files while stopped (RCC change) ● filesystem-caching with cache disabled › should allow to change files while stopped (Pages change) ● filesystem-caching with cache disabled › should allow to change files while stopped (Pages change) ● filesystem-caching with cache disabled › should allow to change files while stopped (Pages change) ● filesystem-caching with cache disabled › should allow to change files while stopped (rename app page) ● filesystem-caching with cache disabled › should allow to change files while stopped (rename app page) ● filesystem-caching with cache disabled › should allow to change files while stopped (rename app page) ● filesystem-caching with cache disabled › should allow to change files while stopped (next config change) ● filesystem-caching with cache disabled › should allow to change files while stopped (next config change) ● filesystem-caching with cache disabled › should allow to change files while stopped (next config change) ● filesystem-caching with cache disabled › should allow to change files while stopped (env var change) ● filesystem-caching with cache disabled › should allow to change files while stopped (env var change) ● filesystem-caching with cache disabled › should allow to change files while stopped (env var change) ● filesystem-caching with cache disabled › should allow to change files while stopped (RSC change, RCC change, Pages change, rename app page, next config change, env var change) ● filesystem-caching with cache disabled › should allow to change files while stopped (RSC change, RCC change, Pages change, rename app page, next config change, env var change) ● filesystem-caching with cache disabled › should allow to change files while stopped (RSC change, RCC change, Pages change, rename app page, next config change, env var change) ● filesystem-caching with cache enabled › should cache or not cache loaders ● filesystem-caching with cache enabled › should cache or not cache loaders ● filesystem-caching with cache enabled › should cache or not cache loaders ● filesystem-caching with cache enabled › should allow to change files while stopped (RSC change) ● filesystem-caching with cache enabled › should allow to change files while stopped (RSC change) ● filesystem-caching with cache enabled › should allow to change files while stopped (RSC change) ● filesystem-caching with cache enabled › should allow to change files while stopped (RCC change) ● filesystem-caching with cache enabled › should allow to change files while stopped (RCC change) ● filesystem-caching with cache enabled › should allow to change files while stopped (RCC change) ● filesystem-caching with cache enabled › should allow to change files while stopped (Pages change) ● filesystem-caching with cache enabled › should allow to change files while stopped (Pages change) ● filesystem-caching with cache enabled › should allow to change files while stopped (Pages change) ● filesystem-caching with cache enabled › should allow to change files while stopped (rename app page) ● filesystem-caching with cache enabled › should allow to change files while stopped (rename app page) ● filesystem-caching with cache enabled › should allow to change files while stopped (rename app page) ● filesystem-caching with cache enabled › should allow to change files while stopped (next config change) ● filesystem-caching with cache enabled › should allow to change files while stopped (next config change) ● filesystem-caching with cache enabled › should allow to change files while stopped (next config change) ● filesystem-caching with cache enabled › should allow to change files while stopped (env var change) ● filesystem-caching with cache enabled › should allow to change files while stopped (env var change) ● filesystem-caching with cache enabled › should allow to change files while stopped (env var change) ● filesystem-caching with cache enabled › should allow to change files while stopped (RSC change, RCC change, Pages change, rename app page, next config change, env var change) ● filesystem-caching with cache enabled › should allow to change files while stopped (RSC change, RCC change, Pages change, rename app page, next config change, env var change) ● filesystem-caching with cache enabled › should allow to change files while stopped (RSC change, RCC change, Pages change, rename app page, next config change, env var change) ● filesystem-caching with cache enabled › should emit turbopack-persistence trace spans ● filesystem-caching with cache enabled › should emit turbopack-persistence trace spans ● filesystem-caching with cache enabled › should emit turbopack-persistence trace spans
Expand output● next/jest › data-testid should be removed in production ● Test suite failed to run |
| import { basename, extname, join, relative, isAbsolute, resolve } from 'path' | ||
| import { pathToFileURL } from 'url' | ||
| import findUp from 'next/dist/compiled/find-up' | ||
| import semver from 'next/dist/compiled/semver' |
There was a problem hiding this comment.
We already always pull in this dependency in the CLI to check your node.js version and exit the CLI with an error if you're on an unsupported version.
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
|
|
||
| const isBun = !!process.versions.bun | ||
| const isDeno = !!process.versions.deno | ||
| if (!isBun && !isDeno) { |
There was a problem hiding this comment.
can we use a positive test instead? isNode?
There was a problem hiding this comment.
You can't check for process.versions.node because bun (and probably deno too, I didn't check) puts fake values there for compatibility reasons.
6b66d82 to
5a467fe
Compare

We want to start dogfooding
workerThreads, but we can only safely do it if you have a new enough node version.We don't have any sort of strong enforcement around node.js version in front (e.g. you could have a misconfigured nvm or fnm), so we need to check the node version first.
Looks like this:
Related Node.js version bump for front: https://github.com/vercel/front/pull/65059