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
I'm trying to build my TypeScript project using ES Modules with ESBuild (not targeting node) and it's failing with
✘ [ERROR] Could not resolve "stream"
node_modules/rfc2047/node_modules/iconv-lite/lib/extend-node.js:167:35:
167 │ var Readable = require('stream').Readable;
╵ ~~~~~~~~
The package "stream" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
✘ [ERROR] Could not resolve "stream"
node_modules/rfc2047/node_modules/iconv-lite/lib/streams.js:1:24:
1 │ var Transform = require("stream").Transform;
╵ ~~~~~~~~
The package "stream" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
#5 seemed similar so I'm wondering if there's an issue with this project + ESBuild (and or ES Modules)?
The text was updated successfully, but these errors were encountered:
var iconvLite;
var iconv;
try {
const pkgName = 'iconv-lite';
iconvLite = require(pkgName);
iconv = require('' + 'iconv'); // Prevent browserify from detecting iconv and failing
} catch (e) {}
However, I'm wondering if there might be a way to have iconv support be completely optional. When I look at the generated output, there's still iconv branches live which means the tree shaking isn't able to perform dead code elimination.
I'm trying to build my TypeScript project using ES Modules with ESBuild (not targeting node) and it's failing with
#5 seemed similar so I'm wondering if there's an issue with this project + ESBuild (and or ES Modules)?
The text was updated successfully, but these errors were encountered: