AnyChart-NodeJS icon indicating copy to clipboard operation
AnyChart-NodeJS copied to clipboard

TypeError when running the example

Open Larsschoen opened this issue 2 years ago • 6 comments

After installation and copying the example code (from the Quick start example), I get the following error when running:

TypeError: Cannot read properties of undefined (reading 'insertBefore') thrown inside /node_modules/anychart/dist/js/anychart-bundle.min.js:84:440

Node: 16.15.1 anychart-nodejs: 1.3.8 OS: MacOS Big Sur 11.6.8

Larsschoen avatar Jul 27 '22 07:07 Larsschoen

same problem - seems to occur when you add the chart to the container chart.container('container');

rebeccapeltz avatar Aug 26 '22 17:08 rebeccapeltz

This worked before. Seems to be broken recently somewhere.

billylo1 avatar Aug 31 '22 13:08 billylo1

@Larsschoen @billylo1 @rebeccapeltz Seeing the same issue as well. I was hoping to ask if there is a known workaround to this?

apatnaik14 avatar Aug 31 '22 23:08 apatnaik14

I gave up after trying different combinations of node, jsdom and anychart. (problem does not seem to be related to the anychart-nodejs add-on). I switched to use quickchart.io

billylo1 avatar Aug 31 '22 23:08 billylo1

Not sure if this helps, but for me the issue was being caused due to a missing dependency. I was using JSDOM to render the window which was being used by anychart. The jsdom was missing in my installed packages. Once I added that dependency the typeError subsided.

apatnaik14 avatar Sep 01 '22 00:09 apatnaik14

I did install the jsdom package.

rebeccapeltz avatar Sep 01 '22 00:09 rebeccapeltz