max-mapper / websocket-stream

websockets with the node stream API
BSD 2-Clause "Simplified" License
667 stars 114 forks source link

no such file or directory, open 'stream' #128

Open binarykitchen opened 7 years ago

binarykitchen commented 7 years ago

Initially reported in https://github.com/calvinmetcalf/rollup-plugin-node-builtins/issues/31#issuecomment-312427554, the following error is really weird:

node_modules/websocket-stream/stream.js🚨   Could not load stream (imported by /home/michael-heuberger/code/videomail-client/node_modules/websocket-stream/stream.js): ENOENT: no such file or directory, open 'stream'

looks like the es6 bundler rollup is trying to find the stream.js file but can't find it. But it does exist in your repo. Btw I have aliased it like that readable-stream:'stream'

Not sure if websocket-stream can be bundled at all with rollup?

mcollina commented 7 years ago

I am not a rollup user, but I think you are close. Keep working on it.

BW, the stream.js file here is not what "readable-stream" exports.

Also, require("readable-stream") has a slightly different API to require("stream"), so it might be that the two are incompatible.

binarykitchen commented 7 years ago

thanks ... trying hard here but am also close to give up :/