Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Recieving "Can't resolve all parameters for HttpXsrfCookieExtractor" after you add some files to the app folder. (Angular) #1242

Closed
elAndyG opened this issue Aug 30, 2017 · 6 comments

Comments

@elAndyG
Copy link

elAndyG commented Aug 30, 2017

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+d__7.MoveNext()

**Is there something with webpack that i need to reset, or does this seem like a bug? **

Steps to reproduce:

  1. cmd to c:\
  2. dotnet --version
    2.0.0
  3. mkdir dummy
  4. cd dummy
  5. dotnet new angular
  6. dotnet restore
  7. npm install
  8. dotnet run

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.

@elAndyG
Copy link
Author

elAndyG commented Aug 30, 2017

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.

@Trapulo
Copy link

Trapulo commented Sep 1, 2017

same problem

Writing some code with angular and .NET is really an hell

@andrei-ga
Copy link

Indeed, at mostly every upgrade there are breaking changes.

@SteveSandersonMS
Copy link
Member

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.

@andrei-ga
Copy link

We already managed to make it work. See aspnet/Templates#866

@SteveSandersonMS
Copy link
Member

Glad to hear it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants