Angular 12 breaks jasmine-auto-spies@6.9.3 (at least for me)
See original GitHub issueAfter updating my project to Angular 12 I get this during startup of the tests (with ng test
).
./node_modules/err-object/src/index.js:1:0-23 - Error: Module not found: Error: Can't resolve 'util' in '/home/vsts/work/1/s/node_modules/err-object/src'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }
npm ls err-object
gives me this
└─┬ jasmine-auto-spies@6.9.3
└─┬ @hirez_io/auto-spies-core@1.6.2
└─┬ code-stringify@2.0.3
└── err-object@4.5.0
I didn’t try out an entirely new project yet. But after removing jasmine-auto-spies
from the project completely tests run again.
I guess its because of the CLI updates due to Angular 12. They updated to webpack 5.
I gave it also a try with installing util
manually but then very strange errors occurred so I quickly reverted that change.
I didn’t dive much deeper into the topic since removing jasmine-auto-spies
fixes it.
=> https://github.com/angular/angular-cli/releases/tag/v12.0.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Angular Update Guide
Select the options that match your update. Angular versions. From v. 16.0, 15.0, 14.0, 13.0, 12.0, 11.0, 10.2, 10.1, 10.0, 9.1, 9.0, 8.2,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should be fixed now
let me know if the problem continues
@gestj @Grilly Thanks for the report! I’ll have time to look at it on Wednesday / Thursday
Maybe @GuilleEneas or @meksof could help in the meantime?