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

Just FYI - this issue was actually introduced in v2.2.x #287

Open
SecuritasMachina opened this issue Dec 7, 2020 · 3 comments
Open

Just FYI - this issue was actually introduced in v2.2.x #287

SecuritasMachina opened this issue Dec 7, 2020 · 3 comments

Comments

@SecuritasMachina
Copy link

SecuritasMachina commented Dec 7, 2020

Seems error has returned in typescript, I receive the below errors using 1.7.1 when navigating away from the route that contains the map.

ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'remove' of undefined
TypeError: Cannot read property 'remove' of undefined
    at LeafletDirective.push.TTNa.LeafletDirective.ngOnDestroy (leaflet.directive.js:107)
ERROR TypeError: Cannot read property 'invalidateSize' of undefined
    at leaflet.directive.js:162
    at ZoneDelegate.invoke (zone-evergreen.js:364)
    at Zone.run (zone-evergreen.js:123)

---------Old reference -----------
Just FYI - this issue was actually introduced in v2.2.x

This should be fixed in 2.5.1, let me know if it's still an issue after you update.

Originally posted by @reblace in #88 (comment)

@RodolpheNivelet
Copy link

RodolpheNivelet commented Dec 7, 2020

Their is the same problem on version 8.1.0, is it going to be corrected on this one as well ?

For information, I am on Angular 10 with @Ngx-leaflet version 8.1.0 and when I arrive directly on the route with the leaflet directive I have :

core.js:4442 ERROR TypeError: Cannot read property 'remove' of undefined
    at LeafletDirective.push.TTNa.LeafletDirective.ngOnDestroy (leaflet.directive.js:107)
    at executeOnDestroys (core.js:9207)
    at cleanUpView (core.js:9131)
    at destroyViewTree (core.js:8957)
    at destroyLView (core.js:9109)
    at ViewContainerRef.remove (core.js:10219)
    at ViewContainerRef.clear (core.js:10126)
    at NgIf._updateView (common.js:3467)
    at NgIf.set ngIf [as ngIf] (common.js:3444)
    at setInputsForProperty (core.js:8797)

When i navigate from another page to this one via Angular routing, it simply does not display anything

@reblace
Copy link
Contributor

reblace commented Dec 27, 2020

This looks like it might just be an issue with not being defensive enough with the null checks. I'll take a look.

@murrple-1
Copy link

Of note, commit 1fd475c is looking like a likely candidate for a fix for this.

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

4 participants