Closed gestj closed 3 years ago
I have integrated jasmine-auto-spies in all my unit tests (~1800) with Angular 11. Upgrading to Angular 12 returned into the same errors as mentioned above.
Unfortunately I also found no workaround but it seams to be a problem with the webpack 5.
@shairez could you please help?
@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?
Sorry @shairez, I am quite busy lately, I can't promise anything. I let you know if I can find some time to check it sooner
Hi guys, Sorry guys, these days a bit busy. From here next August I will get some free time to work on this issue.
Have a great day.
Le sam. 29 mai 2021 à 20:28, Guille Eneas Timón Grau < @.***> a écrit :
Sorry @shairez https://github.com/shairez, I am quite busy lately, I can't promise anything. I let you know if I can find some time to check it sooner
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hirezio/auto-spies/issues/50#issuecomment-850878403, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLIX6XDFIZ24QXRZT4HVJDTQEW3LANCNFSM45DPQI3Q .
It seems that this also happens with other libraries: https://github.com/angular/angular-cli/issues/20819
Should be fixed now
let me know if the problem continues
@shairez
In my case I had the same error message as @gestj when running my tests. After installing v6.9.5 the error message changed to:
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: { "buffer": require.resolve("buffer/") }'
- install 'buffer'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "buffer": false }
npm install buffer
did the trick for me. Can it be solved the same way as it has been with util?
@alexander-merz Thanks!
I just re-tested it with a clean angular 12 install and I don't see this error.
2 options I can think of -
Try to delete node_modules
and reinstall
Maybe you have another library as a dependency which uses buffer...
You can run yarn why buffer
to see who's using it
let me know how it goes
@shairez It was indeed another library's dependency. Thank you!
@alexander-merz sure thing buddy!
After updating my project to Angular 12 I get this during startup of the tests (with
ng test
).npm ls err-object
gives me thisI 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