Skip to content

Commit 2cb51fb

Browse files
committed
fix: resolved the type error when initialize with unsupported node versions
1 parent 946c7b2 commit 2cb51fb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/collector/src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if (!isProcessAvailable()) {
1515

1616
// ESM default exports for TS
1717
module.exports.default = function noOp() {};
18+
module.exports = function noOp() {};
1819

1920
// @ts-ignore TS1108 (return can only be used within a function body)
2021
return;
@@ -32,6 +33,7 @@ if (nodeJsVersionCheck.isNodeJsTooOld()) {
3233

3334
// ESM default exports for TS
3435
module.exports.default = function noOp() {};
36+
module.exports = function noOp() {};
3537

3638
// @ts-ignore TS1108 (return can only be used within a function body)
3739
return;
@@ -48,6 +50,7 @@ if (esm.hasExperimentalLoaderFlag()) {
4850
'https://www.ibm.com/docs/en/instana-observability/current?topic=nodejs-collector-installation.'
4951
);
5052
module.exports.default = function noOp() {};
53+
module.exports = function noOp() {};
5154
// @ts-ignore TS1108
5255
return;
5356
}
@@ -64,6 +67,7 @@ if (esm.hasEsmLoaderFile()) {
6467
'https://www.ibm.com/docs/en/instana-observability/current?topic=nodejs-collector-installation.'
6568
);
6669
module.exports.default = function noOp() {};
70+
module.exports = function noOp() {};
6771
// @ts-ignore TS1108
6872
return;
6973
}

0 commit comments

Comments
 (0)