xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.1k stars 195 forks source link

Vite builds #427

Closed sh5dow2 closed 2 months ago

sh5dow2 commented 2 months ago

Hello,

after switching to Angular 18 and new build system ( vite ) our ngx-echarts stopped working.

Architecture:

I have following error message: [plugin:vite:import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.

project.json

"build_internal": {
            "executor": "@angular-devkit/build-angular:application",
            "outputs": [
                "{options.outputPath}"
            ],
            "options": {
                "allowedCommonJsDependencies": [
                    "ngx-echarts",
                    "echarts"
                ],
...

tsconfig.json

...
"compilerOptions": {
        "target": "ES2022",
        "useDefineForClassFields": false,
        "forceConsistentCasingInFileNames": true,
        "noImplicitAny": false,
        "strict": false,
        "noImplicitOverride": true,
        "noPropertyAccessFromIndexSignature": false,
        "noImplicitReturns": true,
        "noFallthroughCasesInSwitch": true,
        "strictPropertyInitialization": false,
        "skipLibCheck": true,
        "esModuleInterop": true
    },
...

I do not have any specific vite.config.ts file configured as everything should be part of NX workspace.

Can you please advise on how to proceed?

sh5dow2 commented 2 months ago

Closing - update of 'echarts' library solved the issue