Skip to content

Commit 7e674f8

Browse files
committed
Move before non-electron paths
1 parent 326832f commit 7e674f8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/profiling-node/src/cpu_profiler.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
5454
return createdRequire(`${binaryPath}.node`);
5555
}
5656

57+
// @electron/rebuild generates the binary in the generic node-gyp directory
58+
try {
59+
return createdRequire('../../build/Release/sentry_cpu_profiler.node');
60+
} catch (_) {
61+
// ignore
62+
}
63+
5764
// We need the fallthrough so that in the end, we can fallback to the dynamic require.
5865
// This is for cases where precompiled binaries were not provided, but may have been compiled from source.
5966
if (platform === 'darwin') {
@@ -169,13 +176,6 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
169176
}
170177
}
171178

172-
// @electron/rebuild generates the binary in the generic node-gyp directory
173-
try {
174-
return createdRequire('../../build/Release/sentry_cpu_profiler.node');
175-
} catch (_) {
176-
// ignore
177-
}
178-
179179
const built_from_source_path = resolve(esmCompatibleDirname, '..', `sentry_cpu_profiler-${identifier}`);
180180
return createdRequire(`${built_from_source_path}.node`);
181181
}

0 commit comments

Comments
 (0)