Skip to content

Commit 1193694

Browse files
committed
Welcome back dynamicRequire
1 parent f1119b7 commit 1193694

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/node/src/sdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getCurrentHub, initAndBind, Integrations as CoreIntegrations } from '@sentry/core';
22
import { getMainCarrier, setHubOnCarrier } from '@sentry/hub';
33
import { Integration } from '@sentry/types';
4-
import { getGlobalObject } from '@sentry/utils';
4+
import { dynamicRequire, getGlobalObject } from '@sentry/utils';
55
import * as domain from 'domain';
66
import { cwd } from 'process';
77
import * as readPkgUp from 'read-pkg-up';
@@ -142,7 +142,7 @@ function discoverIntegrations(): Integration[] {
142142
return /^@sentry\/integration-(common|node)-[a-z]/.test(name);
143143
})
144144
.map(name => {
145-
const mod = require(require.resolve(name, { paths: [cwd()] }));
145+
const mod = dynamicRequire(module, require.resolve(name, { paths: [cwd()] }));
146146
return Object.values(mod) as { new (): Integration }[];
147147
})
148148
.reduce((acc, integrations) => {

0 commit comments

Comments
 (0)