Hello. After updating the version of Angular to 6.0 I got the next error.
```ERROR in ./node_modules/jszip/lib/readable-stream-browser.js
Module not found: Error: Can't resolve 'stream'
Did anyone have the same?
I resolved that issue by adding the library to the tsconfig.ts like this:
{
...
"compilerOptions": {
...
"paths": {
"jszip": [
"../node_modules/jszip/dist/jszip.min.js"
]
}
}
}
I think that stream is required but not specified as a dependency.
Somehow, I think that readable-stream is used instead of stream when building via grunt, but other build processes do not have that mapping.
I think it's better to:
{
...
"compilerOptions": {
...
"paths": {
"stream": ["../node_modules/readable-stream/readable.js"]
}
}
}
@jmandreslopez Not works for me.
@dinony Works fine with readable-stream.
Thanks @jmandreslopez I did work
@dinony
I think it's better to:
I think you're incorrect. That solution will tell every module in your app to load "readable-stream" instead of "stream", which could easily break other packages / have unintended consequences.
@jmandreslopez's solution is, in general, the superior solution for most apps because it only affects how the jszip module is loaded.
I'll also note that both solutions show the path prefixed with ../. The actual path you should include will depend on where your tsconfig.json file is located. It took me a few minutes to figure out what I was doing wrong.
See also #477 which might be the same issue --- tl;dr: probably not an issue, just a misleading cosmetic warning.
Most helpful comment
I think that
streamis required but not specified as a dependency.Somehow, I think that
readable-streamis used instead ofstreamwhen building via grunt, but other build processes do not have that mapping.I think it's better to: