You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking to add another loader hook but I found some issues with
the existing code:
- To ensure the hook only gets registered once,
`GLOBAL_OBJ._sentryEsmLoaderHookRegistered` is used but it was never set
to true anywhere
- Hook registration was duplicated in `@sentry/node-core` and
`@sentry/node` for preloading
- I moved the Node version check/warning to `supportsEsmLoaderHooks()`
so it can be reused in multiple hooks
debug.warn("Failed to register 'import-in-the-middle' hook",error);
22
29
}
23
-
}else{
24
-
consoleSandbox(()=>{
25
-
// eslint-disable-next-line no-console
26
-
console.warn(
27
-
`[Sentry] You are using Node.js v${process.versions.node} in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.`,
`[Sentry] You are using Node.js v${process.versions.node} in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.`,
coreDebug.warn('Failed to register ESM hook',error);
54
-
}
55
-
}
56
-
}else{
57
-
consoleSandbox(()=>{
58
-
// eslint-disable-next-line no-console
59
-
console.warn(
60
-
`[Sentry] You are using Node.js v${process.versions.node} in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.`,
0 commit comments