-
Hi, after I updated my sveltekit project, I have to switch from sveltekit dev to vite dev, since it is no longer available.
When run my project in dev mode, the carbon charts works, but when running a build I got an error:
This is my vite.config.js file:
Any idea why it is not working anymore? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay, I solved it myself. |
Beta Was this translation helpful? Give feedback.
Okay, I solved it myself.
First, I forgot to tell vite to avoid externalizing "@carbon/charts" when building for production. Second, I added also "carbon-components" to this section. After I added this to my vite.config.js, it builds successful:
ssr: {
noExternal: [
production && '@carbon/charts',
production && 'carbon-components'
].filter(Boolean),
}
Hope it helps for others :)