devextreme-angular: Angular 6: Can't resolve 'stream'
-
Specify the version of the devextreme-angular and devextreme packages you are using. devexteme version: 17.2.7 devextreme-angular version: 17.2.7
-
Specify the type of the issue (check one with “x”): [x] bug Report [ ] feature request [ ] support inquiry
We’re trying to upgrade our project to Angular 6, but we see the following error when including any Dx* modules:
ERROR in ./node_modules/jszip/lib/readable-stream-browser.js
Module not found: Error: Can't resolve 'stream' in 'c:\Source\TestProject\node_modules\jszip\lib'
I’ve tried creating a clean Angular 6 project and just adding DevExtreme, but the results are the same.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 14
- Comments: 42 (2 by maintainers)
Links to this issue
Commits related to this issue
- Add stream NPM module to keep jszip happy See: https://github.com/DevExpress/devextreme-angular/issues/776 — committed to pombase/website by kimrutherford 5 years ago
- Fix jszip build error ERROR in ./node_modules/jszip/lib/readable-stream-browser.js Module not found: Error: Can't resolve 'stream' in '/home/niklas/Projekte/finanztopf/node_modules/jszip/lib' [ERROR]... — committed to Merzlabs/finanztopf by NiklasMerz 4 years ago
This is a change in Angular CLI 6. It’s necessary to register JSZip in the tsconfig.json file as described in the https://github.com/angular/angular-cli/issues/9827#issuecomment-369647555 issue.
funny, I did npm install stream and worked for me 😃
module.exports = require(“readable-stream”); //module.exports = require(“stream”);
just replace this line of code in the file (“readable-stream-browser.js”) until it is fixed by Angular/CLI
Installing random packages that happen to have the name of a NodeJS API, but haven’t been updated for 6 years… What a smart choice. Please request from Devextreme to patch this issue instead of “making it work” on your side with band-aids.
Installing npm “stream” works for me.
npm install stream --save
put 2 dots before “node_modules”
npm install stream --save works for me
npm install stream --save works for me too
npm install stream --save works for me too 😃
npm install stream funciona para mi en angular 7
Still experiencing the same issue with Angular 7, Devextreme ^18.2.3 and ionic 4.
npm install stream --save works for me
Installing npm “stream” works for me.
npm install stream --save
I did npm install stream and worked for me too
it is a bug in “readable-stream” itself, it is missing package stream in the dependencies.
you have to install stream
npm i stream
npm install stream --save помогло!
Thanks man, sorted it out for me.
installing stream worked.
Can confirm… installing stream sorts this out. Thanks @ardymalihi
The guide to adding DevExtreme to an Angular application has this step defined: JSZip Registration, and it fixes the issue.
The npm package
stream
is about 5…7 years old in version0.0.2
. (dead) … No, thanks. But for now, solved by adding the path in tsconfig as workaround.so installing the
stream
package seems to be no good idea, but registering JSZip in the tsconfig.json file (as suggested here), does not work for me, because then the build fails with this:see this Stackoverflow question for details.
So does someone know a solution that fixes both issues?
For me the issue is now solved in jszip version 3.3.0: see Fix browser module resolution #614
I don’t need the outdated stream package or use the JSZip Registration workaround (which broke my typescript type resolution: see SO typescript does not find jszip types)
@GoshaFighten , I tried a bunch of variations of this. And I started to notice the point you made about the path in the error message. But when I got the right amount of
../
in there to get the path correct in the error message, the error message was still there. But then I saw that I added this totsconfig.app.json
instead oftsconfig.json
. Once I moved it to the roottsconfig.json
, and adjusted the path tonode_modules
again, this seems to work now. Thanks for taking a look!