You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WASM crashes on Node v22.2.0 if it reaches the new Buffer() deprecation warning #53075
How often does it reproduce? Is there a required condition?
Fails every time with:
Uncaught TypeError: Cannot read properties of undefined (reading '0')
at isInsideNodeModules (node:internal/util:511:17)
at showFlaggedDeprecation (node:buffer:178:8)
at new Buffer (node:buffer:266:3)
at emval_allocator_3 (eval at craftEmvalAllocator (/tmp/tmp.ujfY2uo6b7/node_modules/zstd-codec/lib/zstd-codec-binding-wasm.js:8:951735), <anonymous>:13:11)
at __emval_new (/tmp/tmp.ujfY2uo6b7/node_modules/zstd-codec/lib/zstd-codec-binding-wasm.js:8:952078)
at wasm://wasm/0025c056:wasm-function[50]:0x10d2
at wasm://wasm/0025c056:wasm-function[87]:0x23c1
What is the expected behavior? Why is that the expected behavior?
This should not fail (and does not, for Node < 22.2.0). In Node v22.1.0 the code snippet above just runs happily without errors.
(Of course, libraries should also update and avoid using deprecated APIs, but it would be good if the deprecation warning itself didn't break anything in the meantime)
What do you see instead?
Fails every time
Additional information
I'm fairly sure that this is due to #52147 (cc @Uzlopak) which changed isInsideNodeModules to check filename[0] for every stack frame.
I'm not really familiar with wasm internals at all, but based on this error I think it looks pretty clear that filename === undefined for wasm stack frames, and so filename[0] crashes for any wasm code that calls that method.
This assessment makes sense. It also means that the method getFileName of a stackFrame, returns undefined. So we need to modify it to also check if filename is not undefined.
Activity
Uzlopak commentedon May 20, 2024
This assessment makes sense. It also means that the method
getFileNameof a stackFrame, returns undefined. So we need to modify it to also check if filename is not undefined.Uzlopak commentedon May 21, 2024
@pimterry
Provided PR #53089
Gudahtt commentedon Jun 26, 2024
This bug is now affecting v20.15.0 as well (#52147 was included in v20.15.0)
[INTERNAL] Replace deprecated new Buffer() calls
[INTERNAL] Replace deprecated new Buffer() calls
Temporarily limit Node versions used in CI to dodge Node bug
aral commentedon Jul 8, 2024
Just a note that this is still an issue in 22.4.0.
avivkeller commentedon Jul 8, 2024
Please see #53089
util: fix crashing when emitting new Buffer() deprecation warning #53075
util: fix crashing when emitting new Buffer() deprecation warning #53075
util: fix crashing when emitting new Buffer() deprecation warning #53075
util: fix crashing when emitting new Buffer() deprecation warning nod…
[INTERNAL] Replace deprecated new Buffer() calls
[INTERNAL] Replace deprecated new Buffer() calls
build(deps): update node to v20.17.0
[ui5-builder][INTERNAL] Replace deprecated new Buffer() calls
[builder][INTERNAL] Replace deprecated new Buffer() calls
adilwahla commentedon Sep 28, 2025
how to fix this i am facing same issue 9-28-2025