-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular 6: Can't resolve 'stream' #776
Comments
module.exports = require("readable-stream"); just replace this line of code in the file ("readable-stream-browser.js") until it is fixed by Angular/CLI |
I migrated today to angular 6 with devextreme 17.2.7 |
This is a change in Angular CLI 6. It's necessary to register JSZip in the tsconfig.json file as described in the angular/angular-cli#9827 (comment) issue. {
...
"compilerOptions": {
...
"paths": {
"jszip": [
"node_modules/jszip/dist/jszip.min.js"
]
}
}
} |
When I try this solution, I get the following error:
It's trying to include jszip from src/node_modules rather than node_modules. I have "fixed" this by temporarily replacing the path by the full path. |
put 2 dots before "node_modules" |
That might fix it in devextreme's case, but I have other dependencies relying on correct behavior for jszip inclusion. |
I've followed the suggested fix, and I'm still getting the same issue. The difference for me is that I am working with an Angular 6 workspace that has multiple applications in it. I've made the {
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": [],
"paths": {
"jszip": ["../../../node_modules/jszip/dist/jszip.min.js"]
}
},
"exclude": ["test.ts", "**/*.spec.ts"]
} But I still get the same error. Is there anything I have to do differently when working in a workspace instead of a single application repo? |
@jakehockey10 . I suggest you check what error message you are getting. For example, you may have your project in the |
@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 |
I just bumped with this problem with DX 18.1.3, this is what "ng version" reports:
I tried the solution modifying tsconfig.json ( Only way to avoid the error is commenting the ONLY line I found in ./node_modules/jszip/lib/readable-stream-browser.js:
|
@ssamayoa, it was indeed the case for me that I had to add this fix in tsconfig.json and double check that my relative paths were correct. As mentioned already, the error message should give a pretty good clue as to what's wrong with the related be path if you scrutinize the path in the error message. You might see a folder missing or something that can help you figure out what your relative paths need to be. |
I repeat: you should not have to play around with relative paths. This is a bug, the path in there is supposed to be relative to the folder that contains node_modules, not something random that depends on some magic. Therefore this issue should not be closed. |
@wartab You mean a bug on DevExpress, algular-cli or in node? |
funny, I did npm install stream and worked for me :) |
Can confirm... installing stream sorts this out. Thanks @ardymalihi |
installing stream worked. |
Installing npm "stream" works for me.
|
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. |
I did npm install stream and worked for me too |
npm install stream --save помогло! |
Installing npm "stream" works for me. npm install stream --save |
npm install stream --save works for me |
I was able to use the semi-non invasive fix from: BrainJS/brain.js#326 (comment) if this helps anyone else. |
npm install stream --save works for me |
npm install stream --save works for me too |
Still experiencing the same issue with Angular 7, Devextreme ^18.2.3 and ionic 4. |
npm install stream --save works for me too :) |
Is any fix for this issue even planned? It doesn't seems to be greatest choice ever to actually install a repository having more than 6 years of inactivity. |
npm install stream funciona para mi en angular 7 |
so installing the
see this Stackoverflow question for details. So does someone know a solution that fixes both issues? |
This worked for me |
The npm package {
"compilerOptions": {
"paths": {
"jszip": ["node_modules/jszip/dist/jszip.min.js"]
}
}
} |
thanks !!! this worked for me. |
Using version 19.1.6 and this is still broken. Is there any intent to fix this issue? |
There's no intent on their end. They say it's not caused by them and stopped replying since then. After this issue and several others, we have started migrating all our Devextreme components to mainly Material Design. The performance gains are gigantic, too. |
I no longer have this problem with Angular 8.x |
|
I am still facing this issue in angular 8 - |
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] An error occurred while running subprocess ng. DevExpress/devextreme-angular#776
The guide to adding DevExtreme to an Angular application has this step defined: JSZip Registration, and it fixes the issue. |
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) |
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:
I've tried creating a clean Angular 6 project and just adding DevExtreme, but the results are the same.
The text was updated successfully, but these errors were encountered: