Closed tpluscode closed 1 year ago
so that instanceof Stream
would work. But maybe we should soft-detect if that's available and fall back to our implementation.
Would you like to send a PR?
Happy to, although I'm not sure what the fix would entail. How would you "soft-detect" in a way which avoid the import?
I expect you can surround the require in try/catch:
try {
var Stream = require('stre' + 'am');
}
catch (err) {}
This will make the Stream
value undefined
both if require
is undefined
and if it fails to find the 'stream'
module.
Additionally, I changed the import to a "computed" value so that tooling will leave it alone.
To be honest, I'm at a loss here. I think I will close the issue for now as it likely exposes some other problem with rollup or @web/test-runner
which not necessarily caused by readable-stream
I started receiving this error when trying to run my tests:
I traced this to a dependency which now uses
v4
of readable-stream. In the modulelib/ours/index.js
there is aconst Stream = require('stream')
Why import the built-in?