Skip to content
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

TypeError: ctorParameters.map is not a function #812

Closed
rhernandez-itemsoft opened this issue Dec 23, 2016 · 16 comments
Closed

TypeError: ctorParameters.map is not a function #812

rhernandez-itemsoft opened this issue Dec 23, 2016 · 16 comments

Comments

@rhernandez-itemsoft
Copy link

Iget this error: "TypeError: ctorParameters.map is not a function" and not found this library.

Steps to reproduce and a minimal demo of the problem*:

1 - npm install angular2-google-maps --save
2 - import { AgmCoreModule } from 'angular2-google-maps/core';
3 - <sebm-google-map [latitude]="lat" [longitude]="lng">
<sebm-google-map-marker [latitude]="lat" [longitude]="lng">

4 - ng serve

@kmmartell
Copy link

I have the exact same issue as well

@sebholstein
Copy link
Owner

@rhernandez-itemsoft @kmmartell can you update to the latest angular version and try it again?

@pichukov
Copy link

I had the same problem and it disappeared after updating to Angular 2.3.1

@fdambrosio
Copy link

fdambrosio commented Dec 29, 2016

I have same issue but I can't upgrade to 2.3.1 because angular-webpack2-starter (with Universal) can't update (yet) to 2.3+

@kmmartell
Copy link

kmmartell commented Dec 29, 2016

Hey everyone - Thanks for feedback. @fdambrosio I got mine to work by just downgrading the Google Maps rather than upgrading angular. I used 0.16 and was previously using 0.17. When I moved to 0.16 that worked fine and the error went away.
Thanks for help,
Kayla

@fdambrosio
Copy link

thanks @kmmartell I moved to 0.16

@wuno
Copy link

wuno commented Dec 29, 2016

I fixed this by running,
npm outdated

Then I updated any angular dependencies that were not latest to the latest versions. In my case

"@angular/common": "2.4.1",
"@angular/compiler": "2.4.1",
"@angular/compiler-cli": "2.4.1",
"@angular/core": "2.4.1",
"@angular/forms": "2.4.1",
"@angular/http": "2.4.1",
"@angular/platform-browser": "2.4.1",
"@angular/platform-browser-dynamic": "2.4.1",
"@angular/platform-server": "2.4.1",
"@angular/router": "3.4.1",
"@angular/upgrade": "2.4.1",

"rxjs": "5.0.1",
"zone.js": "^0.7.2"

Once I did this I received errors with

UNMET PEER DEPENDENCY rxjs@5.0.0-beta.12
└── UNMET PEER DEPENDENCY zone.js@0.6.26

So I upgraded those dependencies to latest as well.
rxjs 5.0.2
zone.js 0.7.4

After that I was able to run npm install and when it finished with no errors I was able to compile my project and run it again.

@sebholstein
Copy link
Owner

There must a breaking change in the 2.4 compiler. I will try to debug it.

@fdambrosio
Copy link

thanks @wuno but now I can't upgrade to 2.4.1 because I'm using https://github.com/qdouble/angular-webpack2-starter

@wuno
Copy link

wuno commented Jan 4, 2017

@fdambrosio Why can't you update your angular 2? I get that it might break some other parts of the app but if there is anything I have learned about developing with Angular2 in the past few months, it is you better get used to things constantly breaking.

@fdambrosio
Copy link

@wuno because we're using Universal branch, and

"the universal starter repo is only updated to 2.1.2... Universal breaks with the newer angular updates as the angular team doesn't currently include it in their tests, that's why I've been updating the universal branch slower than the other branches"

qdouble/angular-webpack-starter#191

@agokrim
Copy link

agokrim commented Jan 17, 2017

Hi @kmmartell how can you downgrade google map to 0.16?
Thanks

@kmmartell
Copy link

@agokrim npm install angular2-google-maps@0.16 --save

@sebholstein
Copy link
Owner

After some research yesterday, I'm not able to fix this. The compiler CLI 2.3 creates uncompatible code for angular 2.2 and smaller. See the details here: http://stackoverflow.com/a/41444599

So the only options are:

  • Update Angular to 2.3 (or better to the latest 2.x version)
  • or use angular2-google-maps version 0.16.0 and update angular when you are ready for it.

Sorry, but there's no other option right now!

@azanebrain
Copy link

To follow up @SebastianM 's answer, I've found that this issue is caused by any number of packages 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/platform-server@2.4.4 requires a peer of @angular/core@2.4.4 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

@leonetosoft
Copy link

I had the same problem...
I'm upgrated packeage.json to Angular 2.3.1

"@angular/common": "~2.3.1",
"@angular/compiler": "~2.3.1",
"@angular/core": "~2.3.1",
"@angular/forms": "~2.3.1",
"@angular/http": "~2.3.1",

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

No branches or pull requests

9 participants