Files
Benjamin WoodruffandGitHub 3d21b79213 Turbopack: Add a check for node version before allowing workerThreads (#91614)
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.

- https://github.com/napi-rs/napi-rs/issues/2555#issuecomment-3645173223
- https://github.com/nodejs/node/pull/55877
- https://github.com/nodejs/node/pull/61400
- https://github.com/nodejs/node/pull/61661

Looks like this:

![Screenshot 2026-03-18 at 1.04.10 PM.png](https://app.graphite.com/user-attachments/assets/bfdb1051-2ebc-403a-af5c-7c715d651aa9.png)

Related Node.js version bump for front: https://github.com/vercel/front/pull/65059
2026-04-06 21:04:42 -07:00

21 lines
402 B
JavaScript

const runtimeStrategy = process.env.TEST_TURBOPACK_PLUGIN_RUNTIME_STRATEGY
module.exports = {
experimental: {
turbopackPluginRuntimeStrategy: runtimeStrategy,
},
compiler: {
defineServer: {
'process.env.__TEST_BUILD_PID': String(process.pid),
},
},
turbopack: {
rules: {
'*.pid': {
as: '*.js',
loaders: ['./pid-loader.js'],
},
},
},
}