question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular 12 breaks jasmine-auto-spies@6.9.3 (at least for me)

See original GitHub issue

After 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
shairezcommented, Jun 9, 2021

Should be fixed now

let me know if the problem continues

1reaction
shairezcommented, May 28, 2021

@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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found