Open btakita opened 1 year ago
Thanks for reporting. You can just use this module. Its version 4 has the circular dependency fixed.
If you still have the problem after upgrading, can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.
For any other bugs in vite-compatible-readable-stream
, please contact their maintainers.
Thanks for reporting!
I'm trying to use readable-stream
with rollup and still run into the circular dependency issue, as version 4.2.0 in fact still has a circular dependency (here <-> here, for example) which then causes problems when using readable-stream in the bundle.
The rollup output complains about the circular dependencies:
Circular dependency: node_modules/readable-stream/lib/internal/streams/duplex.js -> node_modules/readable-stream/lib/internal/streams/readable.js -> node_modules/readable-stream/lib/internal/streams/duplex.js
Circular dependency: node_modules/readable-stream/lib/internal/streams/duplex.js -> node_modules/readable-stream/lib/internal/streams/writable.js -> node_modules/readable-stream/lib/internal/streams/duplex.js
Circular dependency: node_modules/readable-stream/lib/internal/streams/duplex.js -> node_modules/readable-stream/lib/internal/streams/duplexify.js -> node_modules/readable-stream/lib/internal/streams/duplex.js
which then, when attempting to use the (bundled) code, gives me the error
Class extends value undefined is not a constructor or null
where I assume that rollup resolved DuplexStream
to undefined due to rollups handling of the circular dependency.
Atix is right. Rollup bundles fail due to circular dependencies.
When using rollup without vite...the following error occurs on pnpm install:
Note that I use
.pnpmfile.cjs
to aliasreadable-stream
withvite-compatible-readable-stream
. I don't see an issues tab with https://github.com/exogee-technology/readable-stream, so I'm raising the issue here. Hopefully the circular dependency withreadable-stream
will be fixed so thevite-compatible-readable-stream
fork would not be necessary.