From 4f562aee790cc2ff60f304c13bfd304960b28e1c Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Thu, 25 Jan 2024 08:20:47 +0100 Subject: [PATCH] fix(instrumentation)!: pin import-in-the-middle@1.7.1 (#4441) * fix(instrumentation): pin import-in-the-middle@1.7.1 * fix(changelog): add changlog entry * Update experimental/CHANGELOG.md Co-authored-by: Trent Mick * fix(changelog): additional details * fix(changelog): formatting * fix(changelog): lint --------- Co-authored-by: Trent Mick --- experimental/CHANGELOG.md | 6 +++ .../package.json | 2 +- package-lock.json | 48 +++++++++---------- 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 21e254222e..2501ed37ea 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -6,6 +6,12 @@ All notable changes to experimental packages in this project will be documented ### :boom: Breaking Change +* fix(instrumentation)!: pin import-in-the-middle@1.7.1 [#4441](https://github.com/open-telemetry/opentelemetry-js/pull/4441) + * Fixes a bug where, in some circumstances, ESM instrumentation packages would try to instrument CJS exports on ESM, causing the end-user application to crash. + * This breaking change only affects users that are using the *experimental* `@opentelemetry/instrumentation/hook.mjs` loader hook AND Node.js 18.19 or later: + * This reverts back to an older version of `import-in-the-middle` due to + * This version does not support Node.js 18.19 or later + ### :rocket: (Enhancement) ### :bug: (Bug Fix) diff --git a/experimental/packages/opentelemetry-instrumentation/package.json b/experimental/packages/opentelemetry-instrumentation/package.json index 3724bf7ca3..c94165c1fe 100644 --- a/experimental/packages/opentelemetry-instrumentation/package.json +++ b/experimental/packages/opentelemetry-instrumentation/package.json @@ -72,7 +72,7 @@ }, "dependencies": { "@types/shimmer": "^1.0.2", - "import-in-the-middle": "^1.7.2", + "import-in-the-middle": "1.7.1", "require-in-the-middle": "^7.1.1", "semver": "^7.5.2", "shimmer": "^1.2.1" diff --git a/package-lock.json b/package-lock.json index 2524eca71e..237f56e95f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3108,7 +3108,7 @@ "license": "Apache-2.0", "dependencies": { "@types/shimmer": "^1.0.2", - "import-in-the-middle": "^1.7.2", + "import-in-the-middle": "1.7.1", "require-in-the-middle": "^7.1.1", "semver": "^7.5.2", "shimmer": "^1.2.1" @@ -3948,6 +3948,17 @@ "node": ">=10.13.0" } }, + "experimental/packages/opentelemetry-instrumentation/node_modules/import-in-the-middle": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.7.1.tgz", + "integrity": "sha512-1LrZPDtW+atAxH42S6288qyDFNQ2YCty+2mxEPRtfazH6Z5QwkaBSTS2ods7hnVJioF6rkRfNoA6A/MstpFXLg==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-assertions": "^1.9.0", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, "experimental/packages/opentelemetry-instrumentation/node_modules/interpret": { "version": "3.1.1", "dev": true, @@ -19486,17 +19497,6 @@ "node": ">=4" } }, - "node_modules/import-in-the-middle": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.7.2.tgz", - "integrity": "sha512-coz7AjRnPyKW36J6JX5Bjz1mcX7MX1H2XsEGseVcnXMdzsAbbAu0HBZhiAem+3SAmuZdi+p8OwoB2qUpTRgjOQ==", - "dependencies": { - "acorn": "^8.8.2", - "acorn-import-assertions": "^1.9.0", - "cjs-module-lexer": "^1.2.2", - "module-details-from-path": "^1.0.3" - } - }, "node_modules/import-local": { "version": "3.1.0", "dev": true, @@ -40348,7 +40348,7 @@ "codecov": "3.8.3", "cpx": "1.5.0", "cross-var": "1.1.0", - "import-in-the-middle": "^1.7.2", + "import-in-the-middle": "1.7.1", "karma": "6.4.2", "karma-chrome-launcher": "3.1.0", "karma-coverage": "2.2.1", @@ -40406,6 +40406,17 @@ "tapable": "^2.2.0" } }, + "import-in-the-middle": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.7.1.tgz", + "integrity": "sha512-1LrZPDtW+atAxH42S6288qyDFNQ2YCty+2mxEPRtfazH6Z5QwkaBSTS2ods7hnVJioF6rkRfNoA6A/MstpFXLg==", + "requires": { + "acorn": "^8.8.2", + "acorn-import-assertions": "^1.9.0", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, "interpret": { "version": "3.1.1", "dev": true @@ -49648,17 +49659,6 @@ } } }, - "import-in-the-middle": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.7.2.tgz", - "integrity": "sha512-coz7AjRnPyKW36J6JX5Bjz1mcX7MX1H2XsEGseVcnXMdzsAbbAu0HBZhiAem+3SAmuZdi+p8OwoB2qUpTRgjOQ==", - "requires": { - "acorn": "^8.8.2", - "acorn-import-assertions": "^1.9.0", - "cjs-module-lexer": "^1.2.2", - "module-details-from-path": "^1.0.3" - } - }, "import-local": { "version": "3.1.0", "dev": true,