I'm using 0.1.17 of the Angular2 In-Memrory API along with the Angular CLI (with Webpack). I followed all the steps verbatim from the HTTP tutorial and I'm getting the following error:
reflection_capabilities.js:58 Uncaught TypeError: ctorParameters.map is not a function
at ReflectionCapabilities.parameters (http://localhost:4200/main.bundle.js:48626:45)
Here is my app.module.js imports:
imports: [
BrowserModule,
FormsModule,
HttpModule,
AppRoutingModule,
SharedModule,
CoreModule,
// Fake API -- remove for production
InMemoryWebApiModule.forRoot(InMemoryDataService)
],
I'm using 0.1.17 of the Angular2 In-Memrory API along with the Angular CLI (with Webpack). I followed all the steps verbatim from the HTTP tutorial and I'm getting the following error:
reflection_capabilities.js:58 Uncaught TypeError: ctorParameters.map is not a function
at ReflectionCapabilities.parameters (http://localhost:4200/main.bundle.js:48626:45)
Here is my app.module.js imports:
imports: [
BrowserModule,
FormsModule,
HttpModule,
AppRoutingModule,
SharedModule,
CoreModule,
// Fake API -- remove for production
InMemoryWebApiModule.forRoot(InMemoryDataService)
],
Share
Improve this question
asked Dec 12, 2016 at 19:17
Jon GunterJon Gunter
2,1243 gold badges18 silver badges22 bronze badges
3 Answers
Reset to default 4It seems, that your versions don't match. The angular version you are using wants ctorParameters to be an array. But in InMemoryWebApiModule v0.1.17 there is a function provided. Upgrade to v0.2.0. In this version an array is provided.
This bug seems to be linked to some package expecting the version of Angular core to be different than what is actually installed.
I was able to figure out the cause of this issue by looking at the error report from ng build
:
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
This helped me realize that one of my packages expected Angular to be at v2.4.4, but I'm using v2.0.1. I updated my package.json to have both packages set to my core version like this:
"dependencies": {
"@angular/core": "2.0.1",
"@angular/platform-server": "2.0.1",
}
Your issue might not be with @angular/platform-server, but I hope this helps debug it
This error is thrown, when you put wrong sign in a template ==
instead of =
in a parameter assignment.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744705855a4589052.html
评论列表(0条)