cheerio-without-node-native icon indicating copy to clipboard operation
cheerio-without-node-native copied to clipboard

Unable to resolve module stream

Open andy-io opened this issue 7 years ago • 7 comments

Hi, i get this error Unable to resolve module stream RN 0.56 React 16.4.1 After i install stream, then it shows utils, then buffer etc Then finally i get superctor error! Please help to fix this issue

andy-io avatar Sep 25 '18 15:09 andy-io

Hi, could you paste the error stack?

oyyd avatar Sep 25 '18 16:09 oyyd

ok i will post the stack trace. will be great if you could make an example app.

andy-io avatar Sep 27 '18 19:09 andy-io

bundling failed: Error: Unable to resolve module stream from /Users/andy/Projects/xyz/node_modules/cheerio-without-node-native/node_modules/parse5/lib/parser/parser_stream.js: Module stream does not exist in the Haste module map

andy-io avatar Sep 28 '18 22:09 andy-io

Thank you. I will also add a test to prevent it from happening in the future.

oyyd avatar Sep 29 '18 08:09 oyyd

I haven't noticed that recent versions of cheerio include parse5 which uses stream and cheerio rely on parse5 a lot. The fact makes maintaining this lib much more difficult, I think. I might add a notice for new users in README.md later.

@andy-io Using mechanism likes externals of webpack in your bundle tools and require('cheerio') might be a solution. But it depends on how cheerio use parse5.

oyyd avatar Sep 29 '18 09:09 oyyd

Thanks for posting this. I upgraded react-native and am also seeing this problem. Were you guys able to fix it?

Noitidart avatar May 05 '19 00:05 Noitidart

I read this comment - https://github.com/oyyd/cheerio-without-node-native/issues/1#issuecomment-459592814 - thanks for it! I am using v0.20.2 now and its working!

Noitidart avatar May 05 '19 00:05 Noitidart