Skip to content

dynamicRequire causes runtime issues when bundled with webpack #10725

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

Closed
timfish opened this issue Feb 19, 2024 · 1 comment
Closed

dynamicRequire causes runtime issues when bundled with webpack #10725

timfish opened this issue Feb 19, 2024 · 1 comment
Assignees
Labels
Meta: Breaking Package: node Issues related to the Sentry Node SDK
Milestone

Comments

@timfish
Copy link
Collaborator

timfish commented Feb 19, 2024

Which SDK are you using?

@sentry/node

SDK Version

lastest

Steps to Reproduce

This code was added to fix webpack build errors in node < v12

/**
* We need to use dynamicRequire because worker_threads is not available in node < v12 and webpack error will when
* targeting those versions
*/
function getWorkerThreads(): WorkerThreads {
return dynamicRequire(module, 'worker_threads');
}

Unfortunatly this causes runtime issues:
getsentry/sentry-electron#828

Expected Result

Should not error

Actual Result

This can just be removed for the next major since we only support Node versions where worker_threads is available

@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Feb 19, 2024
@timfish timfish changed the title dynamicRequire causes runtime issues when bundles with webpack dynamicRequire causes runtime issues when bundled with webpack Feb 19, 2024
@timfish timfish self-assigned this Feb 19, 2024
@AbhiPrasad AbhiPrasad added this to the 8.0.0 milestone Feb 20, 2024
@timfish
Copy link
Collaborator Author

timfish commented Feb 22, 2024

Closed via #10791

@timfish timfish closed this as completed Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta: Breaking Package: node Issues related to the Sentry Node SDK
Projects
None yet
Development

No branches or pull requests

2 participants