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

SSR: ngOnDestroy generate "Cannot read property 'remove' of undefined" #83

Closed
Egaro555 opened this issue Sep 2, 2021 · 1 comment
Closed

Comments

@Egaro555
Copy link
Contributor

Egaro555 commented Sep 2, 2021

When SSR retrun page with massonry components the server fail when components was destroyed

TypeError: Cannot read property 'remove' of undefined
    at NgxMasonryComponent.remove (/app/dist/frontoffice/server/vendors~src-app-xxx-module.js:3661:49)
    at NgxMasonryDirective.ngOnDestroy (/app/dist/frontoffice/server/vendors~src-app-xxx-module.js:3857:21)
    at executeOnDestroys (/app/dist/frontoffice/server/main.js:81930:18)
    at cleanUpView (/app/dist/frontoffice/server/main.js:81833:5)
    at destroyViewTree (/app/dist/frontoffice/server/main.js:81620:9)
    at destroyLView (/app/dist/frontoffice/server/main.js:81803:5)
    at RootViewRef.destroy (/app/dist/frontoffice/server/main.js:100098:7)
    at /app/dist/frontoffice/server/main.js:109238:21
    at Array.forEach (<anonymous>)
    at ApplicationRef.ngOnDestroy (/app/dist/frontoffice/server/main.js:109237:27)

due to missing isPlatformBrowser in line

this.masonryInstance.remove(element);

Egaro555 pushed a commit to Egaro555/ngx-masonry that referenced this issue Sep 2, 2021
wynfred pushed a commit that referenced this issue Sep 3, 2021
@wynfred
Copy link
Owner

wynfred commented Sep 3, 2021

Released!

@wynfred wynfred closed this as completed Sep 3, 2021
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

2 participants