Skip to content

Commit

Permalink
use createRequire
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jul 24, 2024
1 parent 0a462ba commit ef8ce53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/profiling-node/src/cpu_profiler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { createRequire } from 'node:module';
import { arch as _arch, platform as _platform } from 'node:os';
import { join, resolve } from 'node:path';
import { env, versions } from 'node:process';
Expand Down Expand Up @@ -28,6 +29,7 @@ const built_from_source_path = resolve(__dirname, '..', `./sentry_cpu_profiler-$
*/
// eslint-disable-next-line complexity
export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
const require = createRequire(import.meta.url);
// If a binary path is specified, use that.
if (env['SENTRY_PROFILER_BINARY_PATH']) {
const envPath = env['SENTRY_PROFILER_BINARY_PATH'];
Expand Down
1 change: 0 additions & 1 deletion packages/profiling-node/test/spanProfileUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ describe('continuous profiling mode', () => {
makeClientOptions({ profilesSampler: undefined, profilesSampleRate: 0 }),
],
])('%s', async (_label, options) => {
logger.enable();
const client = new Sentry.NodeClient({
...options,
dsn: 'https://[email protected]/1337',
Expand Down

0 comments on commit ef8ce53

Please sign in to comment.