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

Console Error: Cannot read property 'parentElement' of null when using maps-lazy-load-params on NgMap page #879

Closed
nicholaspretorius opened this issue Nov 1, 2018 · 9 comments

Comments

Projects
None yet
6 participants
@nicholaspretorius
Copy link

commented Nov 1, 2018

Good day Allen,

When viewing the NgMap demo page at: https://ngmap.github.io/#/!map-lazy-load-params.html

A console error is displayed when clicking on the map marker to open the info window.

Steps to reproduce - no plunker provided as this exists on the NgMap demo page

  • Load url above with map-lazy-load-params example
  • Open developer tools in Chrome
  • Click on map marker to open an info window

Current behavior

  • When clicking on the map marker, a console error is displayed with the message:
    TypeError: Cannot read property 'parentElement' of null
    at info-window.js:114
    at angular.js:16299
    at completeOutstandingRequest (angular.js:4924)
    at angular.js:5312"

Line 114 of info-window.js

var infoWindowContainerEl = infoWindow.content.parentElement.parentElement.parentElement;

image

Expected/desired behavior

  • Info window should open without a console error.

Other information

  • If you close the info-window and then open it again, there is no console error.
  • This console error only happens on first load/click of the map marker.
@madmarcel

This comment has been minimized.

Copy link

commented Nov 6, 2018

I'm seeing the same issue. Working on a fix...

@mdorion1

This comment has been minimized.

Copy link

commented Nov 23, 2018

Any update on this?
I have the same problem in my project..

Thank you!

@allenhwkim

This comment has been minimized.

Copy link
Owner

commented Nov 25, 2018

I believe this happens because of a racing condition. I think Chrome browser tries perform faster than before. I can wrap like with a if condition

if (infoWindow.content.parentElement) {
  var infoWindowContainerEl = infoWindow.content.parentElement.parentElement.parentElement;
  infoWindowContainerEl.className = "ng-map-info-window";
}

allenhwkim added a commit that referenced this issue Nov 25, 2018

allenhwkim added a commit that referenced this issue Nov 25, 2018

@allenhwkim

This comment has been minimized.

Copy link
Owner

commented Nov 25, 2018

v1.18.5 is released with this fix

@allenhwkim allenhwkim closed this Nov 25, 2018

@nicholaspretorius

This comment has been minimized.

Copy link
Author

commented Dec 18, 2018

Thank you!

@wholeinsoul

This comment has been minimized.

Copy link

commented Jan 19, 2019

v1.18.5 is released with this fix

HI @allenhwkim , when will you release this version v1.18.5 ?
Thank you.

EDIT:
For future reference: It is released here.
//cdn.jsdelivr.net/npm/ngmap@1.18.5/build/scripts/ng-map.min.js"

@Rouvo

This comment has been minimized.

Copy link

commented Apr 24, 2019

Hi @allenhwkim,
I really like your library, but I ran into the same bug.

When are you going to realease the mentioned version with the bug fix?

@wholeinsoul

This comment has been minimized.

Copy link

commented Apr 25, 2019

For future reference: It is released here.
//cdn.jsdelivr.net/npm/ngmap@1.18.5/build/scripts/ng-map.min.js"

Hi @allenhwkim,
I really like your library, but I ran into the same bug.

When are you going to realease the mentioned version with the bug fix?

@Rouvo

This comment has been minimized.

Copy link

commented Apr 25, 2019

Thanks for the quick reply, enjoy the day and thanks for your great work! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.