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
When using esbuild to transpile/bundle specific code on node 20.15 it triggers a runtime error.
The same code transpiled/executed with esbuild on 20.14 works fine.
If we bypass esbuild and run the code directly on 20.15 it also works.
node:internal/util:508
filename[0] !== '/' &&
^
TypeError: Cannot read properties of null (reading '0')
at isInsideNodeModules (node:internal/util:508:17)
at showFlaggedDeprecation (node:buffer:178:8)
at new Buffer (node:buffer:266:3)
at utils.normalizeInputSource (file:///Users/dev/exceljsbug/dist/index.js:44519:16)
at Archiver.append (file:///Users/dev/exceljsbug/dist/index.js:44932:21)
at file:///Users/dev/exceljsbug/dist/index.js:49153:20
at new Promise (<anonymous>)
at WorkbookWriter.addThemes (file:///Users/dev/exceljsbug/dist/index.js:49152:16)
at new WorkbookWriter (file:///Users/dev/exceljsbug/dist/index.js:49040:42)
at handler (file:///Users/dev/exceljsbug/dist/index.js:64169:20)
at file:///Users/dev/exceljsbug/test.js:2:7
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
This seems a Node.js bug: nodejs/node#54296
The test-straight.js works because it simply does not hit the preconditions of the issue: The new Buffer() deprecation check only happens outside of node_modules. The straight way of calling exceljs obviously leaves the code containing new Buffer() inside node_modules. While dist/index.js is outside of it.
When using esbuild to transpile/bundle specific code on node 20.15 it triggers a runtime error.
The same code transpiled/executed with esbuild on 20.14 works fine.
If we bypass esbuild and run the code directly on 20.15 it also works.
Minimal repo to reproduce: https://github.com/brunoargolo/esbuild-node20.15-exceljs-bug/tree/master
Code:
index.js
test.js
esbuild.js is inside repo listed above
Error:
The text was updated successfully, but these errors were encountered: