hustcc / hustcc/echarts-for-react
[Bug] Inconsistent CJS interop
- Dominant language
- TypeScript
- Stars
- 5k
- Forks
- 650
- PR merge metrics
- No merged PRs in 30d
Description
### Version
3.0.6
### Link to Minimal Reproduction
https://stackblitz.com/edit/vitejs-vite-jyrcmi77?file=src%2Fmain.tsx
### Steps to Reproduce
1. Start a demo project with Vite 8
2. Setup echarts-for-react on the first component
3. Run the code in dev mode
4. Open the browser
It crashes with the error:
```txt
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
```
The failure occurs with `EChartsReactCore`.
### Current Behavior
It crashes.
### Expected Behavior
It does not crash.
### Environment
```markdown
- OS: Windows 11
- Browser: 149.0b10 (aarch64)
- Framework: React@19
```
### Any additional comments?
Documented on Vite 8 side:
- https://github.com/vitejs/vite/issues/21841
- https://vite.dev/guide/migration#consistent-commonjs-interop
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.