Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error after importing #7

Open
jisuo opened this issue Dec 1, 2023 · 1 comment
Open

Getting error after importing #7

jisuo opened this issue Dec 1, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jisuo
Copy link

jisuo commented Dec 1, 2023

ReferenceError: exports is not defined
    at node_modules/rc-echart/lib/Chart.js (Chart.js:24:23)
    at __init (chunk-7REXU52E.js?v=eb06a9c8:16:56)
    at node_modules/rc-echart/lib/index.js (index.js:17:14)
    at __require2 (chunk-7REXU52E.js?v=eb06a9c8:19:50)
    at index.js:19:38

Line 24 in Chart.js is:

Object.defineProperty(exports, "__esModule", { value: true });

I have "type": "module" in package.json and tsconfig is:

{
  "compilerOptions": {
    "target": "ESNext",
    "lib": ["dom", "dom.iterable", "esnext"],
    "types": ["vite/client", "vite-plugin-svgr/client"],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",
    "baseUrl": "src"
  },
  "include": ["src"]
}

Not sure why it transpiled into CommonJs?

@lloydzhou lloydzhou added the bug Something isn't working label Dec 3, 2023
@lloydzhou lloydzhou self-assigned this Dec 3, 2023
@TechQuery
Copy link

You can try ECharts Web components library: https://github.com/idea2app/ECharts-JSX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants