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

Uncaught Error at onDestroy #87

Open
MaximilianMain opened this issue Oct 19, 2020 · 0 comments
Open

Uncaught Error at onDestroy #87

MaximilianMain opened this issue Oct 19, 2020 · 0 comments

Comments

@MaximilianMain
Copy link

MaximilianMain commented Oct 19, 2020

In our application we get in some cases an uncaught error from ngx-gauge:
ERROR TypeError: Cannot read property 'clearRect' of undefined
at NgxGauge._clear (vendor.js:82965)
at NgxGauge._destroy (vendor.js:82999)
at NgxGauge.ngOnDestroy (vendor.js:82930)
at executeOnDestroys (vendor.js:136785)
at cleanUpView (vendor.js:136709)
at destroyViewTree (vendor.js:136535)
at destroyLView (vendor.js:136687)
at ViewContainerRef.remove (vendor.js:137797)
at ViewContainerRef.clear (vendor.js:137704)
at SafeSubscriber._next (main.js:15265)

The error happens on the call of the clear method of a ViewContainerRef in which the ngx-gauge is inside.

We are using Angular 10. Core: 10.1.1
I have tested it with 10.1.6 as well and got the same error.

Maybe in the _clear Method there should be a null check for the context?

private _clear() {
    this._context?.clearRect(0, 0, this._getWidth(), this._getHeight());
}
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

1 participant