-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Failed to build project with JSZip library #10625
Comments
I have the same error. |
Same for me. :s |
Same for me |
Same 👎 |
My short fix:
|
Worked for me as well, thank you! :) |
I have the same error message with |
Same here as @frohrka . But I don't specifically have jszip in my package.json |
Yes, that did work, but seems to be a hacky workaround....Next time the packages are updated/reloaded, will have to do that again. Not ideal. |
Please see the following comment: #9827 (comment) Duplicate of #9827 |
@kodermax How this can be fixed when you are running the build from the build pipeline? |
@sachinpachori Please see this comment: #9827 (comment) |
It was hot fix. {
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"paths": {
"jszip": [
"../node_modules/jszip/dist/jszip.js"
]
},
"lib": [
"es2017",
"dom"
]
}
}
|
I tried it with and without 2 dots before node_modules in the path....still getting the error: Module not found: Error: Can't resolve 'stream' in 'D:\a\1\s\node_modules\jszip\lib' |
ERROR in ./node_modules/jszip/lib/readable-stream-browser.js�[39m�[22m�[0m |
Correct solution is in the comment linked above. |
@clydin If you are mentioning about your comment on Mar 2 then that is what I tried and still facing the error mentioned above. |
@sachinpachori I added this to my package.json file
Than in your build script:
Not ideal but it works |
Thanks @ztimson. I created a custom npm task in build definition and put the command "npm run fix" there and getting the error: What am I doing wrong here? |
That solution is confirmed to work. Ensure it is placed in the application's tsconfig not the root tsconfig. Also ensure the path (relative to the baseUrl) matches the project structure. If that error is shown, the path mapping is either not being used or the file is not being found. The files in |
@sachinpachori I am not sure why, but the error is that it doesn't recognize the command Can you show me the package.json line where you put the command? |
that is what I was wondering too :) |
@clydin Earlier I put it in the root one and now I tried it with app tsconfig but it fails with the same error. |
@ztimson |
@sachinpachori if you look at my snippit again I escaped the quotes with a backslash. Your code isn't escaping them. |
@ztimson It is missed while pasting but I checked it is there in the checked in code and not working. Do I need to use your solution in addition to what clydin suggested or need to use yours only? Moreover," npm run" is not recognized and it shall not be related to the escape character I guess. Do you have a working build definition which you can share? |
It is fixed now. Thanks @ztimson your fix worked. Issue was in build definition. |
Thanks @ztimson your fix worked like a charm! |
|
@aifrim Worked for me |
@aifrim npm i stream also worked fo rme |
@aifrim Worked for me |
@aifrim work for me. |
This is the true solution. All the answers before trigger workarounds, but no solutions |
this solution causes other issues - see Stackoverflow: typescript does not find jszip types So the better option, in my opinion, is to install the stream package
as answered by @aifrim comment-link |
This just worked for me with Angular 8. Angular Templates & ASP.NET Core don't seem to play nicely. This is the true fix, everything else is work-around. |
Angular 7ERROR in ./node_modules/jszip/lib/readable-stream-browser.js I am facing this issue in my application after added.
Then after some searching, I found this solution. I Just replace:
It perfectly works for me, I don't recommend you to go for this approach it is one the approach that is a good solution. Thanks! Happy Coding |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Repro steps
ng new jszip-test
cd .\jszip-test\
npm i --save jszip
ng build
Observed behavior
Desired behavior
Should be able to build a project without errors.
Mention any other details that might be useful (optional)
This works as expected with angular-cli 1.7
The text was updated successfully, but these errors were encountered: