Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dd-trace can't init with node v20.15 #4550

Open
Tarektouati opened this issue Jul 24, 2024 · 2 comments
Open

dd-trace can't init with node v20.15 #4550

Tarektouati opened this issue Jul 24, 2024 · 2 comments

Comments

@Tarektouati
Copy link

Tarektouati commented Jul 24, 2024

Hey 👋🏼

We are experiencing an issue with dd-trace v5.17.0 in our application with node v20.15

We get this kind of error :

TypeError: An error occurred while loading instrumentation hook: Cannot read properties of undefined (reading '0')
    at isInsideNodeModules (node:internal/util:508:17)
    at showFlaggedDeprecation (node:buffer:178:8)
    at new Buffer (node:buffer:266:3)
    at alloc (webpack-internal:///(instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/bufferish-buffer.js:18:10)
    at eval (webpack-internal:///(instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/bufferish-buffer.js:6:54)
    at (instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/bufferish-buffer.js (front/.next/server/vendor-chunks/[email protected]:59:1)
    at __webpack_require__ (front/.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///(instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/bufferish.js:17:37)
    at (instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/bufferish.js (/front/.next/server/vendor-chunks/[email protected]:89:1)
    at __webpack_require__ (front/.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///(instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/ext-buffer.js:5:17)
    at (instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/ext-buffer.js (front/.next/server/vendor-chunks/[email protected]:199:1)
    at __webpack_require__ (front/.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///(instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/write-core.js:3:18)
    at (instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/write-core.js (front/.next/server/vendor-chunks/[email protected]:279:1)
    at __webpack_require__ (front/.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///(instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/encode-buffer.js:5:15)
    at (instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/encode-buffer.js (front/.next/server/vendor-chunks/[email protected]:159:1)
    at __webpack_require__ (front/.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///(instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/encode.js:5:21)
    at (instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/lib/encode.js (front/.next/server/vendor-chunks/[email protected]:179:1)
    at __webpack_require__ (front/.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///(instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/index.js:3:18)
    at (instrument)/../../node_modules/.pnpm/[email protected]/node_modules/msgpack-lite/index.js (front/.next/server/vendor-chunks/[email protected]:19:1)
    at __webpack_require__ (front/.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///(instrument)/../../node_modules/.pnpm/[email protected]_patch_hash=kg3ltbvalaupys75dltxj3lf7a/node_modules/dd-trace/packages/dd-trace/src/datastreams/writer.js:5:17)
    at (instrument)/../../node_modules/.pnpm/[email protected]_patch_hash=kg3ltbvalaupys75dltxj3lf7a/node_modules/dd-trace/packages/dd-trace/src/datastreams/writer.js (front/.next/server/vendor-chunks/[email protected]_patch_hash=kg3ltbvalaupys75dltxj3lf7a.js:3988:1)

the issue seems to be coming from msgpack-lite in packages/dd-trace/src/datastreams/writer.js

Edit:

Seems that msgpack-lite last update relates to 8 years ago https://github.com/kawanet/msgpack-lite
Maybe this fork could fix the issue https://github.com/JoshuaWise/tiny-msgpack ?

Thanks

@thebigbluebox
Copy link

Had to lock my Node 20 version to Node 20.15.1 instead of the latest release from yesterday which is now 20.16.0.

Realized my build was utilizing just Node 20 which was causing the issue which only happened overnight on 2024-07-25.

@unkhz
Copy link

unkhz commented Sep 9, 2024

Reproduced the problem with node version 20.15.1. Problem was fixed by updating to latest (20.17.0 today).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants