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

view.destroy is not a function #379

Open
gjbohnnon opened this issue May 3, 2021 · 4 comments
Open

view.destroy is not a function #379

gjbohnnon opened this issue May 3, 2021 · 4 comments

Comments

@gjbohnnon
Copy link

Intended outcome:

routing away from a component with does not cause viewer.destroy() in AcMapComponent to throw and error

Actual outcome:
routing away from a component with does not cause viewer.destroy() in AcMapComponent to not throw and error

How to reproduce the issue:
using angular router, route to another component what doesn't have
Version

  • angular-cesium@0.0.67
@Crocsx
Copy link

Crocsx commented May 8, 2021

That is because the error is this :

TypeError: viewer.destory is not a function

so must be a typo somewhere in the code

@AFTERWAKE
Copy link

Also seeing this issue, wanted to provide more information.
When trying to navigate to another component, console shows the following error, and Angular does not complete navigation:

core.js:6210 ERROR Error: Uncaught (in promise): TypeError: viewer.destory is not a function
TypeError: viewer.destory is not a function
    at AcMapComponent.ngOnDestroy (angular-cesium.js:3007)
    at executeOnDestroys (core.js:7405)
    at cleanUpView (core.js:7318)
    at destroyViewTree (core.js:7144)
    at destroyLView (core.js:7296)
    at RootViewRef.destroy (core.js:22601)
    at ComponentRef$1.destroy (core.js:25144)
    at RouterOutlet.deactivate (router.js:5307)
    at ActivateRoutes.deactivateRouteAndOutlet (router.js:2072)
    at ActivateRoutes.deactivateRouteAndItsChildren (router.js:2050)
    at resolvePromise (zone-evergreen.js:1213)
    at resolvePromise (zone-evergreen.js:1167)
    at zone-evergreen.js:1279
    at ZoneDelegate.invokeTask (zone-evergreen.js:406)
    at Object.onInvokeTask (core.js:28540)
    at ZoneDelegate.invokeTask (zone-evergreen.js:405)
    at Zone.runTask (zone-evergreen.js:178)
    at drainMicroTaskQueue (zone-evergreen.js:582)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:491)
    at invokeTask (zone-evergreen.js:1600)

I'm assuming the viewer.destroy function is called as a part of the NgDestroy. But looking into the viewer object, it doesn't grab any of the prototype functions from cesium.Viewer, which includes the .destroy function.
I couldn't figure out what to change to have it access the prototype functions, but hopefully this helps find a solution.

I'm using v0.0.67 with Angular v11.2.12.

@ramtob
Copy link
Contributor

ramtob commented Jun 1, 2021

I encountered a similar crash. After upgrading to the latest version (0.0.71) it was fixed.

@AFTERWAKE
Copy link

I encountered a similar crash. After upgrading to the latest version (0.0.71) it was fixed.

Can confirm this fixed it for me as well

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