-
Notifications
You must be signed in to change notification settings - Fork 17
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 TypeError: Cannot read property 'appendChild' #23
Comments
+1 |
same here. this is not related to the Angular.JS integration, but to zingchart itself, since we see the error in an Angular application. |
@gnardecky any idea how to solve this? ngOnDestroy() {
this._onDestroy.next();
this._onDestroy.complete();
if (this._currentChart) {
this.zone.runOutsideAngular(() => {
zingchart.exec(this._currentChart.id, 'destroy');
});
}
} but the error still appears |
Here is a demo that demonstates the issue: https://codepen.io/macjohnny-zh/pen/LJVooJ The problem also occurs if the containing element is not removed, which you can try with the following example: The stack-trace is slightly different in that case:
Note: if you have troubles reproducing the issue, remove the The error also occurs when not explicitly calling |
the settings
seem to resolve the issue in some cases, but not always. |
The issue seems to be resolved with zingchart version zingchart.DEV.GC = 0; in order to avoid a ngOnDestroy() {
...
this.zone.runOutsideAngular(() => {
zingchart.exec(this._currentChart.id, 'destroy');
});
}
} |
@ctaity could you try |
I have the same problem here, update to 2.8.1 don't fix the issue. |
@skilltik what is the error message you get? |
|
with zingchart 2.7.0 and these three lines that you suggested: zingchart.DEV.RESIZESPEED = 10; looks like the issue is solved. |
@skilltik the With Zingchart
are only a workaround and in our case did not always resolve the problem. With |
version |
When the controller destroys (change to another view) i get:
Uncaught TypeError: Cannot read property 'appendChild' of null
at Object.AAF (eval at (http://localhost:3000/bower_components/zingchart/client/zingchart.min.js:8:1), :1:70276)
at Object.HB (eval at (http://localhost:3000/bower_components/zingchart/client/zingchart.min.js:8:1), :1:69912)
at c.paint (eval at (http://localhost:3000/bower_components/zingchart/client/zingchart.min.js:8:1), :1:257198)
at c.f.(anonymous function) [as paint] (eval at (http://localhost:3000/bower_components/zingchart/client/zingchart.min.js:8:1), :1:17736)
at eval (eval at (http://localhost:3000/bower_components/zingchart/client/zingchart.min.js:8:1), :1:278976)
at c.OG (eval at (http://localhost:3000/bower_components/zingchart/client/zingchart.min.js:8:1), :1:249889)
at eval (eval at (http://localhost:3000/bower_components/zingchart/client/zingchart.min.js:8:1), :1:278950)
AAF @ VM4969:1
HB @ VM4969:1
paint @ VM4969:1
f.(anonymous function) @ VM4969:1
(anonymous) @ VM4969:1
OG @ VM4969:1
(anonymous) @ VM4969:1
setTimeout (async)
XS @ VM4969:1
(anonymous) @ VM4969:1
zingchart.A0G @ VM4969:1
JN @ VM4969:1
zingchart.AAD @ VM4969:1
zingchart.ABS @ VM4969:1
zingchart.exec @ VM4969:1
(anonymous) @ zingchart-angularjs.js:84
$digest @ angular.js:18210
$apply @ angular.js:18480
(anonymous) @ angular.js:14373
dispatch @ jquery.min.js:3
r.handle @ jquery.min.js:3
The code of the controller is:
And the code of the view is:
I try remove element on destroy, but nothing, can you help me_
The text was updated successfully, but these errors were encountered: