You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Vite: preventing "chart type X is not registered" errors
312
-
313
-
Vite's dependency pre-bundler can create two separate copies of the ApexCharts module — one for `apexcharts/core` and separate ones for each sub-entry — causing registrations to be lost. If you see this error even though you have the correct imports, add your apexcharts entries to `optimizeDeps.include`:
314
-
315
-
```js
316
-
// vite.config.js
317
-
exportdefault {
318
-
optimizeDeps: {
319
-
include: [
320
-
'apexcharts/core',
321
-
'apexcharts/line',
322
-
'apexcharts/bar',
323
-
// ...all apexcharts/* entries you import
324
-
'apexcharts/features/legend',
325
-
'apexcharts/features/toolbar',
326
-
],
327
-
},
328
-
}
329
-
```
330
-
331
-
This forces Vite to pre-bundle all sub-entries together so they share a single ApexCharts instance and all registrations are preserved.
0 commit comments