Skip to content

fix(sourceWorker): inherit execArgv so tsx loader reaches micro-workers#201

Closed
dripink wants to merge 2 commits intoPerformanC:devfrom
dripink:fix/source-worker-execargv-tsx-loader
Closed

fix(sourceWorker): inherit execArgv so tsx loader reaches micro-workers#201
dripink wants to merge 2 commits intoPerformanC:devfrom
dripink:fix/source-worker-execargv-tsx-loader

Conversation

@dripink
Copy link
Copy Markdown

@dripink dripink commented Apr 21, 2026

Changes

Passing execArgv: process.execArgv fixes the crash-respawn loop seen with the default npm start script.

Why

Worker threads spawned via new Worker(__filename) do not inherit process.execArgv, which causes them to crash when the parent was started with --import tsx.

Checkmarks

  • The modified endpoints have been tested.
  • Used the same indentation as the rest of the project.
  • Still compatible with LavaLink clients.

Additional information

If you have any additional information, write it here

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

All Contributors have signed the CLA. The PR is now allowed to be merged.
Posted by the CLA Assistant Lite bot.

@dripink
Copy link
Copy Markdown
Author

dripink commented Apr 21, 2026

I have read the CLA Document and I hereby sign the CLA

@UnschooledGamer
Copy link
Copy Markdown
Collaborator

recheck

@UnschooledGamer
Copy link
Copy Markdown
Collaborator

@doyimmiuink please use a email linked to your GitHub account.

@dripink
Copy link
Copy Markdown
Author

dripink commented Apr 21, 2026

I will create another PR with the correct credentials; you can discard this one.

Worker threads spawned via new Worker(__filename) do not inherit
process.execArgv, causing them to crash when the parent was started
with --import tsx. Passing execArgv: process.execArgv fixes the
crash-respawn loop seen with the default npm start script.
@dripink dripink force-pushed the fix/source-worker-execargv-tsx-loader branch from 221778f to 47c9491 Compare April 21, 2026 09:28
@dripink
Copy link
Copy Markdown
Author

dripink commented Apr 21, 2026

recheck

@dripink
Copy link
Copy Markdown
Author

dripink commented Apr 21, 2026

updated with the correct email linked to my GitHub account. Ready for review

@UnschooledGamer
Copy link
Copy Markdown
Collaborator

Great, thanks. We'll merge it soon.

@1Lucas1apk 1Lucas1apk changed the base branch from v3 to dev April 21, 2026 10:23
@UnschooledGamer UnschooledGamer self-assigned this Apr 21, 2026
@UnschooledGamer
Copy link
Copy Markdown
Collaborator

@doyimmiuink the issue is still present for me on NodeJS version v22.14.0. Is the fix working for you?

image

@UnschooledGamer
Copy link
Copy Markdown
Collaborator

UnschooledGamer commented Apr 21, 2026

It's a nodejs problem, as it's working fine on v22.22.2 but not on v22.14.0

@dripink
Copy link
Copy Markdown
Author

dripink commented Apr 21, 2026

I'll review this here, as some that I tested worked, but some didn't.

@dripink
Copy link
Copy Markdown
Author

dripink commented Apr 21, 2026

Fix not working on my end. The only workaround I found for the build is adding extra heap space so it doesn't run out of memory:
node --max-old-space-size=512 node_modules/typescript/bin/tsc --incremental false
Note that the required value may vary depending on the available memory of the host machine.
Also, I had an idea: a plugin registry specifically for NodeLink, similar to npm but focused only on NodeLink plugins. This would make it much easier for developers to publish, discover, and install plugins. Would you be open to this as a separate project under the PerformanC organization, or at least linking it from the NodeLink docs?

@1Lucas1apk
Copy link
Copy Markdown
Member

This request will be denied because it is incomplete, and the solution will be implemented in the dev branch.

@1Lucas1apk 1Lucas1apk closed this Apr 23, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants