I've tried multiple projects in both VS Code using the dotnet new, as well as the Visual Studio 2017 Angular templates for Angular. Once i begin adding new files to the app folder, it seems fine and hot modules properly. But once i stop the build and start it again, I receive the following error:
NodeInvocationException: Can't resolve all parameters for HttpXsrfCookieExtractor: (?, [object Object], [object Object]).
Error: Can't resolve all parameters for HttpXsrfCookieExtractor: (?, [object Object], [object Object]).
at Error (native)
at syntaxError (C:\toolkit3\ClientApp\dist\vendor.js:37092:34)
at CompileMetadataResolver.module.exports.CompileMetadataResolver._getDependenciesMetadata (C:\dummy\ClientApp\dist\vendor.js:51159:35)
at CompileMetadataResolver.module.exports.CompileMetadataResolver._getTypeMetadata (C:\dummy\ClientApp\dist\vendor.js:51027:26)
at CompileMetadataResolver.module.exports.CompileMetadataResolver._getInjectableMetadata (C:\dummy\ClientApp\dist\vendor.js:51013:21)
at CompileMetadataResolver.module.exports.CompileMetadataResolver.getProviderMetadata (C:\dummy\ClientApp\dist\vendor.js:51304:40)
at C:\dummy\ClientApp\dist\vendor.js:51233:49
at Array.forEach (native)
at CompileMetadataResolver.module.exports.CompileMetadataResolver._getProvidersMetadata (C:\dummy\ClientApp\dist\vendor.js:51193:19)
at CompileMetadataResolver.module.exports.CompileMetadataResolver.getNgModuleMetadata (C:\dummy\ClientApp\dist\vendor.js:50848:50)
Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance+
*Is there something with webpack that i need to reset, or does this seem like a bug? *
Steps to reproduce:
start copying or adding files into the app/ folder.
kill the build
trigger dotnet run again...
I think i've done 5 straight new projects and have been able to reproduce it each time. Please let me know if i can supply you with any additional information.
I did some more research, and it looks like it cannot update to version 4.3.0+ (currently trying to update to 4.3.6.) so if you update the @angular items in package config to 4.3.6 this error will immediately trigger. It also refers to this module here. https://angular.io/api/common/http/HttpClientXsrfModule.
I will move this issue over to the aspnet/templates sp please feel free to close this ticket as i believe i reported this in the wrong area.
same problem
Writing some code with angular and .NET is really an hell
Indeed, at mostly every upgrade there are breaking changes.
Thanks for letting us know.
start copying or adding files into the app/ folder.
Which specific files should you copy or add? Because adding arbitrary unrelated files to that dir doesn't have any effect.
Am I right in understanding that the real repro is "update Angular packages to 4.3.0+"? If so, we certainly will be updating the templates to 4.3.0+ at some point, but until then we can't guarantee compatibility with arbitrary future Angular versions because they can introduce breaking changes at any time.
We already managed to make it work. See https://github.com/aspnet/Templates/issues/866
Glad to hear it.
Most helpful comment
Indeed, at mostly every upgrade there are breaking changes.