Home Forums Chart Support Charts break on built/server for vite react app.

Charts break on built/server for vite react app.

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

    I have a vite react application in which i have installed canvasJs charts, but when I try to built the folder it breaks saying require is not defined. I checked the logs its when we do npm run build, the charts imports have require instead of import. This is limiting me from using this pakage in my app. how can i resolve this ?

    #45064

    @denzil,

    Adding commonjsOptions: { transformMixedEsModules: true } to the build option of Vite config should fix this issue. Please refer to this Stack Overflow thread for more information about the same.

    __
    Sachin Bisht
    Team CanvasJS

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

You must be logged in to reply to this topic.