Skip to content

Commit 116e21d

Browse files
author
Luca Forstner
committed
fix(node): Depend on import-in-the-middle directly for loader hooks
1 parent 2c161f6 commit 116e21d

File tree

6 files changed

+75
-14
lines changed

6 files changed

+75
-14
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ jobs:
10031003
'create-remix-app-express',
10041004
'create-remix-app-express-vite-dev',
10051005
'debug-id-sourcemaps',
1006-
# 'esm-loader-node-express-app', # This is currently broken for upstream reasons. See https://github.com/getsentry/sentry-javascript/pull/11338#issuecomment-2025450675
1006+
'esm-loader-node-express-app',
10071007
'nextjs-app-dir',
10081008
'nextjs-14',
10091009
'react-create-hash-router',

dev-packages/e2e-tests/test-applications/esm-loader-node-express-app/tests/server.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ test('Should record exceptions captured inside handlers', async ({ request }) =>
1313

1414
test('Should record a transaction for a parameterless route', async ({ request }) => {
1515
const transactionEventPromise = waitForTransaction('esm-loader-node-express-app', transactionEvent => {
16-
console.log('txn', transactionEvent.transaction);
1716
return transactionEvent?.transaction === 'GET /test-success';
1817
});
1918

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
import { register } from 'module';
2-
register('@opentelemetry/instrumentation/hook.mjs', import.meta.url);
2+
register('import-in-the-middle/hook.mjs', import.meta.url);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import { getFormat, getSource, load, resolve } from '@opentelemetry/instrumentation/hook.mjs';
1+
import { getFormat, getSource, load, resolve } from 'import-in-the-middle/hook.mjs';
22
export { getFormat, getSource, load, resolve };

packages/node/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"access": "public"
5555
},
5656
"dependencies": {
57+
"import-in-the-middle": "^1.7.4",
5758
"@opentelemetry/api": "^1.8.0",
5859
"@opentelemetry/context-async-hooks": "^1.23.0",
5960
"@opentelemetry/core": "^1.23.0",

yarn.lock

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8331,8 +8331,17 @@
83318331
dependencies:
83328332
"@types/unist" "*"
83338333

8334-
"@types/history-4@npm:@types/[email protected]", "@types/history-5@npm:@types/[email protected]", "@types/history@*":
8335-
name "@types/history-4"
8334+
"@types/history-4@npm:@types/[email protected]":
8335+
version "4.7.8"
8336+
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
8337+
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
8338+
8339+
"@types/history-5@npm:@types/[email protected]":
8340+
version "4.7.8"
8341+
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
8342+
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
8343+
8344+
"@types/history@*":
83368345
version "4.7.8"
83378346
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
83388347
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
@@ -8691,7 +8700,15 @@
86918700
"@types/history" "^3"
86928701
"@types/react" "*"
86938702

8694-
"@types/react-router-4@npm:@types/[email protected]", "@types/react-router-5@npm:@types/[email protected]":
8703+
"@types/react-router-4@npm:@types/[email protected]":
8704+
version "5.1.14"
8705+
resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.14.tgz#e0442f4eb4c446541ad7435d44a97f8fe6df40da"
8706+
integrity sha512-LAJpqYUaCTMT2anZheoidiIymt8MuX286zoVFPM3DVb23aQBH0mAkFvzpd4LKqiolV8bBtZWT5Qp7hClCNDENw==
8707+
dependencies:
8708+
"@types/history" "*"
8709+
"@types/react" "*"
8710+
8711+
"@types/react-router-5@npm:@types/[email protected]":
86958712
version "5.1.14"
86968713
resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.14.tgz#e0442f4eb4c446541ad7435d44a97f8fe6df40da"
86978714
integrity sha512-LAJpqYUaCTMT2anZheoidiIymt8MuX286zoVFPM3DVb23aQBH0mAkFvzpd4LKqiolV8bBtZWT5Qp7hClCNDENw==
@@ -9860,6 +9877,11 @@ acorn-import-assertions@^1.9.0:
98609877
resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac"
98619878
integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==
98629879

9880+
acorn-import-attributes@^1.9.5:
9881+
version "1.9.5"
9882+
resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef"
9883+
integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==
9884+
98639885
acorn-jsx@^5.3.1:
98649886
version "5.3.1"
98659887
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b"
@@ -18631,6 +18653,16 @@ [email protected]:
1863118653
cjs-module-lexer "^1.2.2"
1863218654
module-details-from-path "^1.0.3"
1863318655

18656+
import-in-the-middle@^1.7.4:
18657+
version "1.7.4"
18658+
resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.7.4.tgz#508da6e91cfa84f210dcdb6c0a91ab0c9e8b3ebc"
18659+
integrity sha512-Lk+qzWmiQuRPPulGQeK5qq0v32k2bHnWrRPFgqyvhw7Kkov5L6MOLOIU3pcWeujc9W4q54Cp3Q2WV16eQkc7Bg==
18660+
dependencies:
18661+
acorn "^8.8.2"
18662+
acorn-import-attributes "^1.9.5"
18663+
cjs-module-lexer "^1.2.2"
18664+
module-details-from-path "^1.0.3"
18665+
1863418666
import-lazy@^2.1.0:
1863518667
version "2.1.0"
1863618668
resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
@@ -25709,8 +25741,7 @@ react-is@^18.0.0:
2570925741
dependencies:
2571025742
"@remix-run/router" "1.0.2"
2571125743

25712-
"react-router-6@npm:[email protected]", [email protected]:
25713-
name react-router-6
25744+
"react-router-6@npm:[email protected]":
2571425745
version "6.3.0"
2571525746
resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.3.0.tgz#3970cc64b4cb4eae0c1ea5203a80334fdd175557"
2571625747
integrity sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ==
@@ -25725,6 +25756,13 @@ react-router-dom@^6.2.2:
2572525756
history "^5.2.0"
2572625757
react-router "6.3.0"
2572725758

25759+
25760+
version "6.3.0"
25761+
resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.3.0.tgz#3970cc64b4cb4eae0c1ea5203a80334fdd175557"
25762+
integrity sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ==
25763+
dependencies:
25764+
history "^5.2.0"
25765+
2572825766
react@^18.0.0:
2572925767
version "18.0.0"
2573025768
resolved "https://registry.yarnpkg.com/react/-/react-18.0.0.tgz#b468736d1f4a5891f38585ba8e8fb29f91c3cb96"
@@ -27960,8 +27998,7 @@ string-template@~0.2.1:
2796027998
resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add"
2796127999
integrity sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=
2796228000

27963-
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
27964-
name string-width-cjs
28001+
"string-width-cjs@npm:string-width@^4.2.0":
2796528002
version "4.2.3"
2796628003
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
2796728004
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -27987,6 +28024,15 @@ string-width@^2.1.0:
2798728024
is-fullwidth-code-point "^2.0.0"
2798828025
strip-ansi "^4.0.0"
2798928026

28027+
string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
28028+
version "4.2.3"
28029+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
28030+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
28031+
dependencies:
28032+
emoji-regex "^8.0.0"
28033+
is-fullwidth-code-point "^3.0.0"
28034+
strip-ansi "^6.0.1"
28035+
2799028036
string-width@^5.0.0, string-width@^5.0.1, string-width@^5.1.2:
2799128037
version "5.1.2"
2799228038
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
@@ -28082,7 +28128,14 @@ stringify-object@^3.2.1:
2808228128
is-obj "^1.0.1"
2808328129
is-regexp "^1.0.0"
2808428130

28085-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", [email protected], strip-ansi@^6.0.0, strip-ansi@^6.0.1:
28131+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
28132+
version "6.0.1"
28133+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
28134+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
28135+
dependencies:
28136+
ansi-regex "^5.0.1"
28137+
28138+
[email protected], strip-ansi@^6.0.0, strip-ansi@^6.0.1:
2808628139
version "6.0.1"
2808728140
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
2808828141
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -30713,8 +30766,7 @@ workerpool@^6.4.0:
3071330766
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.4.0.tgz#f8d5cfb45fde32fa3b7af72ad617c3369567a462"
3071430767
integrity sha512-i3KR1mQMNwY2wx20ozq2EjISGtQWDIfV56We+yGJ5yDs8jTwQiLLaqHlkBHITlCuJnYlVRmXegxFxZg7gqI++A==
3071530768

30716-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
30717-
name wrap-ansi-cjs
30769+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
3071830770
version "7.0.0"
3071930771
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
3072030772
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -30732,6 +30784,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0:
3073230784
string-width "^4.1.0"
3073330785
strip-ansi "^6.0.0"
3073430786

30787+
wrap-ansi@^7.0.0:
30788+
version "7.0.0"
30789+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
30790+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
30791+
dependencies:
30792+
ansi-styles "^4.0.0"
30793+
string-width "^4.1.0"
30794+
strip-ansi "^6.0.0"
30795+
3073530796
wrap-ansi@^8.1.0:
3073630797
version "8.1.0"
3073730798
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"

0 commit comments

Comments
 (0)