question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot read property 'push' of undefined

See original GitHub issue

I’m submitting a … (check one with “x”) [x] question [ ] any problem or bug report [ ] feature request

The plugin version: (check one with “x”) [ ] 2.0-beta3 (github) [x] 2.0 (npm)

cordova information: (run $> cordova plugin list)

cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-googlemaps 2.0.11 "cordova-plugin-googlemaps"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"

If you use ionic-native/google-maps, please show me the package.json “dependencies”: { “angular/common”: “4.1.3”, “angular/compiler”: “4.1.3”, “angular/compiler-cli”: “4.1.3”, “angular/core”: “4.1.3”, “angular/forms”: “4.1.3”, “angular/http”: “4.1.3”, “angular/platform-browser”: “4.1.3”, “angular/platform-browser-dynamic”: “4.1.3”, “ionic-native/core”: “3.12.1”, “ionic-native/geolocation”: “^4.2.1”, “ionic-native/google-maps”: “^4.3.0”, “ionic-native/splash-screen”: “3.12.1”, “ionic-native/status-bar”: “3.12.1”, “ionic/storage”: “2.0.1”, “ngx-translate/core”: “6.0.1”, “ngx-translate/http-loader”: “0.0.3”, “chart.js”: “^2.7.0”, “cordova-android”: “^6.3.0”, “cordova-plugin-compat”: “^1.2.0”, “cordova-plugin-device”: “^1.1.4”, “cordova-plugin-geolocation”: “^2.4.3”, “cordova-plugin-googlemaps”: “git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git”, “cordova-plugin-splashscreen”: “^4.0.3”, “cordova-plugin-statusbar”: “^2.2.2”, “cordova-plugin-whitelist”: “^1.3.1”, “ionic-angular”: “3.6.1”, “ionic-plugin-keyboard”: “^2.2.1”, “ionicons”: “3.0.0”, “rxjs”: “5.4.0”, “sw-toolbox”: “3.6.0”, “tslint-config-airbnb”: “^5.3.0”, “zone.js”: “0.8.12” },

Current behavior: Gets an error but the marker is marked;

Uncaught TypeError: Cannot read property ‘push’ of undefined

Related code, data or error log (please format your code or data):

this.map.addMarker({
            title: 'Current Location',
            icon: 'red',
            animation: 'DROP',
            position: {
              lat: this.location.lat,
              lng: this.location.lng,
            },
            draggable: true,
          }).then((marker) => {
            marker.addEventListener(GoogleMapsEvent.INFO_CLICK).subscribe(() => {
              console.log('ffv');
            });
          });

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
uiktiomasfelizcommented, Oct 16, 2017

In my case the error shows when i use the old way to create map: this.map = new GoogleMap(this.mapElement, mapOptions);

When i create the map using this.map = this.googleMaps.create(this.mapElement, mapOptions); , the error disapear but i can’t see map, i verify api key’s and all stufs…

2reactions
RanmalNcommented, Oct 16, 2017

The error got fixed when this.map = this.googleMaps.create(this.mapElement, mapOptions); is used insted of this.map = new GoogleMap(this.mapElement, mapOptions);

Thanks @uiktiomasfeliz @wf9a5m75 for the help

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix TypeError: Cannot read Property 'push' of ...
When working with JavaScript arrays, you have to be careful that you are not calling the push() , pop() , shift() , unShift()...
Read more >
TypeError: Cannot read Property 'push' of Undefined in JS
The "Cannot read property push of undefined" error occurs when trying to call the push() method on an undefined value. Make sure the...
Read more >
Cannot read property 'push' of undefined when combining ...
answer to your question is simple order is not a object make it an array. var order = new Array(); order.push(/item to push/);...
Read more >
TypeError: Cannot read property 'push' of undefined - JavaScript
This error message is telling us that the object we are calling it upon does not exist or is undefined. The error traces...
Read more >
TypeError: Cannot read property push of undefined - YouTube
Fix: TypeError : Cannot read property push of undefined. ▶️ Say "Hello ‍♂️" to me On: Facebook : https://fb.com/...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found