AnyChart / AnyChart-NodeJS

ARCHIVED. AnyChart NodeJS module provides an easy way to generate SVG, JPG and PNG images of the charts on the server side.
https://www.anychart.com
Apache License 2.0
46 stars 8 forks source link

TypeError when running the example #26

Open Larsschoen opened 2 years ago

Larsschoen commented 2 years ago

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

rebeccapeltz commented 2 years ago

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

billylo1 commented 2 years ago

This worked before. Seems to be broken recently somewhere.

apatnaik14 commented 2 years ago

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

billylo1 commented 2 years ago

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

apatnaik14 commented 2 years ago

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.

rebeccapeltz commented 2 years ago

I did install the jsdom package.