From 5aa22a2e5bc716ad6a9506b831b5f7169ecc91b4 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 12 Dec 2024 12:12:47 +0000 Subject: [PATCH] idk fix? --- packages/profiling-node/rollup.npm.config.mjs | 3 +-- packages/profiling-node/src/cpu_profiler.ts | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/profiling-node/rollup.npm.config.mjs b/packages/profiling-node/rollup.npm.config.mjs index c0da1ddb3e24..47a5f0843951 100644 --- a/packages/profiling-node/rollup.npm.config.mjs +++ b/packages/profiling-node/rollup.npm.config.mjs @@ -12,8 +12,7 @@ const require = createRequire(import.meta.url); `; const ESMDirnameShim = ` -const filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); +const __dirname = dirname(fileURLToPath(import.meta.url)); `; function makeESMImportShimPlugin(shim) { diff --git a/packages/profiling-node/src/cpu_profiler.ts b/packages/profiling-node/src/cpu_profiler.ts index bbdf2c621844..b9a4acd722be 100644 --- a/packages/profiling-node/src/cpu_profiler.ts +++ b/packages/profiling-node/src/cpu_profiler.ts @@ -164,10 +164,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings { } // #START_SENTRY_ESM_DIRNAME_SHIM - // const filename = fileURLToPath(import.meta.url); - // const __dirname = dirname(filename); + // const __dirname = dirname(fileURLToPath(import.meta.url)); // #END_SENTRY_ESM_DIRNAME_SHIM - const built_from_source_path = resolve(__dirname, '..', `./sentry_cpu_profiler-${identifier}`); + const built_from_source_path = resolve(__dirname, '..', `sentry_cpu_profiler-${identifier}`); return require(`${built_from_source_path}.node`); }