Skip to content

dynamicRequire causes runtime issues when bundled with webpack #10725

Closed
@timfish

Description

@timfish

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

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions