You must be logged in to post your query.
Home › Forums › Report Bugs › Application breaks in react v18 build
Tagged: React build v18
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.
@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.
commonjsOptions: { transformMixedEsModules: true }
__ Sachin Bisht Team CanvasJS
You must be logged in to reply to this topic. Login/Register