Files
klz-cables.com/.pnpm-store/v10/files/f5/135c2039e920cc5874776eaefd31092a456bd8674d582c972d117e54b0a74dd8b4e6fccc3be7b0fcbd8addc94f46d4b002f6488263b4793729874c4823fc63
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

43 lines
1.2 KiB
Plaintext

import { consoleSandbox } from '@sentry/core';
import { NODE_MAJOR, NODE_MINOR } from '../nodeVersion.js';
/** Detect CommonJS. */
function isCjs() {
try {
return typeof module !== 'undefined' && typeof module.exports !== 'undefined';
} catch {
return false;
}
}
let hasWarnedAboutNodeVersion;
/**
* Check if the current Node.js version supports module.register
*/
function supportsEsmLoaderHooks() {
if (isCjs()) {
return false;
}
if (NODE_MAJOR >= 21 || (NODE_MAJOR === 20 && NODE_MINOR >= 6) || (NODE_MAJOR === 18 && NODE_MINOR >= 19)) {
return true;
}
if (!hasWarnedAboutNodeVersion) {
hasWarnedAboutNodeVersion = true;
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
`[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.`,
);
});
}
return false;
}
export { isCjs, supportsEsmLoaderHooks };
//# sourceMappingURL=detection.js.map