Home Forums StockChart Support stockcharts and charts do not work in vue or nuxt or even in npm runkit

stockcharts and charts do not work in vue or nuxt or even in npm runkit

Viewing 2 posts - 1 through 2 (of 2 total)
  • #44914

    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?

    #44934

    @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.

    Integrate CanvasJS Charts in Nuxt Application

    Also, check out this documentation page of nuxt to know more about client side component.

    —-
    Manoj Mohan
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.