You must be logged in to post your query.
Home › Forums › StockChart Support › stockcharts and charts do not work in vue or nuxt or even in npm runkit
Tagged: Installation
First I thought its a problem with vuetify. So I made a new project with nuxt only. But I get the same error all over the place. Even in the npm runkit https://npm.runkit.com/%40canvasjs%2Fvue-stockcharts
ReferenceError: document is not defined Reason: No document object in node. RunKit is a node environment, so document and other browser features won’t exist.
any ideas?
@klauskobald,
CanvasJS is a client-side library that requires browser environment and APIs to run. You should prevent running CanvasJS in the server environment. To do so in Nuxt app, you can use .client suffix to your component containing CanvasJS Chart. Please checkout this StackBlitz example for an example on integrating CanvasJS Charts in Nuxt app.
.client
Also, check out this documentation page of nuxt to know more about client side component.
—- Manoj Mohan Team CanvasJS
You must be logged in to reply to this topic. Login/Register