Title: [worker_threads] inherited --vfs-load is skipped when --import is present · Issue #66270 · nodejs/node · GitHub
Open Graph Title: [worker_threads] inherited --vfs-load is skipped when --import is present · Issue #66270 · nodejs/node
X Title: [worker_threads] inherited --vfs-load is skipped when --import is present · Issue #66270 · nodejs/node
Description: Version v24.x main Proposed change A worker that inherits parent execArgv should apply an inherited --vfs-load mount before resolving its entry file, including when the parent also uses --import. Current behavior lib/internal/main/worker...
Open Graph Description: Version v24.x main Proposed change A worker that inherits parent execArgv should apply an inherited --vfs-load mount before resolving its entry file, including when the parent also uses --import. C...
X Description: Version v24.x main Proposed change A worker that inherits parent execArgv should apply an inherited --vfs-load mount before resolving its entry file, including when the parent also uses --import. C...
Opengraph URL: https://github.com/nodejs/node/issues/66270
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[worker_threads] inherited --vfs-load is skipped when --import is present","articleBody":"### Version\n\nv24.x main\n\n### Proposed change\n\nA worker that inherits parent `execArgv` should apply an inherited `--vfs-load` mount before resolving its entry file, including when the parent also uses `--import`.\n\n### Current behavior\n\n`lib/internal/main/worker_thread.js` only calls `finishVfsMounts()` before loading the worker when there are no imports:\n\n```js\nif (imports.length === 0) {\n finishVfsMounts()\n}\n```\n\nThe file-worker path reaches `Module.runMain(filename)`, which calls `resolveMainPath()` before `runEntryPointWithESMLoader()` installs the inherited VFS mount. A worker entry inside the inherited VFS therefore fails to resolve when the parent command also contains `--import`.\n\n### Steps to reproduce\n\nCreate `noop.mjs`, then:\n\n```js\n// app/index.js\nconst path = require('node:path')\nconst {Worker} = require('node:worker_threads')\n\nnew Worker(path.join(__dirname, 'worker.js'))\n .on('message', console.log)\n .on('error', console.error)\n```\n\n```js\n// app/worker.js\nrequire('node:worker_threads').parentPort.postMessage('ok')\n```\n\nRun:\n\n```console\nnode --experimental-vfs --import ./noop.mjs --vfs-load ./app\n```\n\nExpected: the worker loads `app/worker.js` from the inherited VFS and prints `ok`.\n\nActual: worker entry resolution happens before the inherited mount is installed, so loading fails.\n\n### Regression test\n\nExtend `test/parallel/test-vfs-load.js` with the existing inherited-worker scenario and an otherwise empty `--import` preload.\n\nI found no existing issue or PR covering `--vfs-load` together with `--import` for inherited workers.\n","author":{"url":"https://github.com/januththedev","@type":"Person","name":"januththedev"},"datePublished":"2026-09-25T01:09:01Z","url":"https://github.com/nodejs/node/issues/66270"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4e24cad0-944a-7436-36e6-30bda53320c4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5A2:2463B8:63C9D9:819953:6AED2BA8 |
| html-safe-nonce | bfb1da9d86c8970fd397e9d3efd59527fce8f43eb10390a64a7d3313040ebce2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUEyOjI0NjNCODo2M0M5RDk6ODE5OTUzOjZBRUQyQkE4IiwidmlzaXRvcl9pZCI6IjMzNjQ0ODMzMjE5NzI5OTI5MzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6a4e1cbbbfd63667e00104fe028f824d089f088395377f728abe77d8bf1a09fc |
| hovercard-subject-tag | issue:5576641374 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66270/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f12cb4b870caeadd5cc1b0bfffc80aa4eaa01bd890ce97c10dd8b4f3cb4d71bf/nodejs/node/issues/66270 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f12cb4b870caeadd5cc1b0bfffc80aa4eaa01bd890ce97c10dd8b4f3cb4d71bf/nodejs/node/issues/66270 |
| og:image:alt | Version v24.x main Proposed change A worker that inherits parent execArgv should apply an inherited --vfs-load mount before resolving its entry file, including when the parent also uses --import. C... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | januththedev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 98b41fa4b5635ceb45a4c54320fced73817ff290 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width