Skip to content

Commit a42c7e4

Browse files
committed
fix: handled instana export safely when using experimental loader (#2227)
Prevented a runtime crash when using `--experimental-loader` with the v5 collector.
1 parent 241cc0e commit a42c7e4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/collector/esm-loader.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
*/
2222

2323
import instana from './src/index.js';
24-
instana();
24+
25+
if (typeof instana === 'function') {
26+
instana();
27+
}
2528
// Here we export all named exports from '@instana/core/iitm-loader.mjs', enabling
2629
// integration of import-in-the-middle (IITM) for Native ESM module support.
2730
export * from '@instana/core/iitm-loader.mjs';

0 commit comments

Comments
 (0)