这是indexloc提供的服务,不要输入任何密码
Skip to content

fix: Replace parentPort.close() with process.exit() in worker thread #1140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

valentinpalkovic
Copy link

@valentinpalkovic valentinpalkovic commented Jun 6, 2024

This change ensures the worker thread signals the parent process to exit in the bun runtime environment. Previously, the parent process would continue running indefinitely due to an unclear issue with worker thread termination. This fix ensures a clean exit after the worker thread has completed its tasks.

Context:

This bug stops us from fully migrating to the bun runtime for the Storybook mono repo without additional workarounds.

Reproduction:

Run tsup programmatically in a bun runtime instead of Node.js and define some DTS options so that the rollup worker thread spawns. With this fix, after building the DTS assets, the process exits successfully. Before, the process never exited.

This change ensures that the worker thread signals the parent process to exit in the bun runtime environment. Previously, the parent process would continue running indefinitely due to an unclear issue with worker thread termination. This fix ensures a clean exit after the worker thread has completed its tasks.
Copy link

codesandbox bot commented Jun 6, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

vercel bot commented Jun 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tsup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2024 9:44am

@sxzz
Copy link
Collaborator

sxzz commented Jul 20, 2024

Fixed by #1142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants