spliffone commented on issue #20554:
URL: https://github.com/apache/echarts/issues/20554#issuecomment-2998956105

   We face a similar issue after upgrading to Angular 20 which come with a new 
typescript version 5.8.0. The `ng build` is failing with the following error:
   
   ```bash
   ✘ [ERROR] TS1203: Export assignment cannot be used when targeting ECMAScript 
modules. Consider using 'export default' or another module format instead. 
[plugin angular-compiler]
   
       node_modules/echarts/index.d.ts:23:0:
         23 │ export = echarts;
            ╵ ~~~~~~~~~~~~~~~~~
   ```
   
   Since we use bundler with target es2022 the only workaround I found is to 
add `skipLibCheck`:
   
   ```json
   {
     ...
     "compilerOptions": {
       "module": "es2022",
       "moduleResolution": "Bundler",
       "target": "es2022",
       "skipLibCheck": true,
       ...
     }
   }
   ```
   
   But I believe it is better to adjust the types file 
`https://github.com/apache/echarts/blob/master/index.d.ts`:
   
   ```diff
   ...
   - import * as echarts from './types/dist/echarts';
   + export * from './types/dist/echarts'
   // Export for UMD module.
   export as namespace echarts;
   - export = echarts;
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to