securenow 8.11.0 → 8.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/register.js CHANGED
@@ -4,9 +4,12 @@
4
4
  // For ESM apps ("type": "module"), this file auto-registers the
5
5
  // OpenTelemetry ESM loader hook via module.register() (Node >=20.6).
6
6
  // On older Node versions it falls back to a warning.
7
- 'use strict';
8
-
9
- // 1. Auto-register the ESM loader hook so customers never need --import
7
+ 'use strict';
8
+
9
+ // Do nothing inside Node's internal ESM-hooks thread (see internal-thread.js).
10
+ if (require('./internal-thread').inInternalThread()) return;
11
+
12
+ // 1. Auto-register the ESM loader hook so customers never need --import
10
13
  (() => {
11
14
  try {
12
15
  const fs = require('fs');
@@ -14,7 +17,7 @@
14
17
  const pkgPath = path.resolve(process.cwd(), 'package.json');
15
18
  if (!fs.existsSync(pkgPath)) return;
16
19
 
17
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8').replace(/^\uFEFF/, ''));
20
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8').replace(/^\uFEFF/, ''));
18
21
  if (pkg.type !== 'module') return;
19
22
 
20
23
  // Already registered via --import?
@@ -37,5 +40,5 @@
37
40
  }
38
41
  })();
39
42
 
40
- // 2. Run the OTel SDK setup
41
- require('./tracing');
43
+ // 2. Run the OTel SDK setup
44
+ require('./tracing');