Home Forums Report Bugs Application breaks in react v18 build

Application breaks in react v18 build

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

    Everythings works fine in dev, but the moment I do npm run build and generate the dist folder, and try to run that i get a error “require is not defined”.
    And the app crashes.

    #45066

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