-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
SPA Angular 11->12 updates #33353
SPA Angular 11->12 updates #33353
Conversation
src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/angular.json
Outdated
Show resolved
Hide resolved
It's fine if we do this, I remember we hit a similar thing when we upgraded to webpack 5 on SignalR and other places. install 'util'
add a fallback 'resolve.fallback: { "util": require.resolve("util/") }' |
It wasn't clear how best I could do this easily since angular doesn't expose webpack directly, have to do some kind of webpack custom builder? |
@HaoK ahh, that's true. How does this work on a new template? |
I'm not sure what codepaths in the auth that actually rely on util or process, its the ng test command that runs into this. I was able to login normally just fine, so I'm not sure if there are actual functionality that stops working due to util/process/browser changes. |
src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/proxy.conf.js
Outdated
Show resolved
Hide resolved
@HaoK can you point out what files are causing grief to the tests? |
@javiercn the login/logout files:
|
So I can make the errors go away and the tests pass if I just delete the logging/util usage in both of the spec files, maybe that's the easiest fix |
That sounds like an appropriate fix. |
Cool things look good now with ng test, I think this PR is ready to go |
Fixes #33076
Note: When individual auth is enabled, ng test run on the ClientApp will fail due to issues with webpack 5 removing polyfills for node.js core modules, specifically util, and then process due to bootstrap.
ng test output errors
But other wise, the angular template seems to runs fine with this PR