nwalters512 opened a new issue, #21250:
URL: https://github.com/apache/echarts/issues/21250

   ### Version
   
   6.0.0
   
   ### Link to Minimal Reproduction
   
   https://github.com/nwalters512/echarts-typescript-esm-repro
   
   ### Steps to Reproduce
   
   Install dependencies:
   
   ```sh
   yarn install
   ```
   
   Try to build the project:
   
   ```sh
   yarn build
   ```
   
   
   ### Current Behavior
   
   Observe that there are a number of TypeScript errors:
   
   ```
   node_modules/echarts/charts.d.ts:20:15 - error TS2834: Relative import paths 
need explicit file extensions in ECMAScript imports when '--moduleResolution' 
is 'node16' or 'nodenext'. Consider adding an extension to the import path.
   
   20 export * from './types/dist/charts';
                    ~~~~~~~~~~~~~~~~~~~~~
   
   node_modules/echarts/index.d.ts:20:26 - error TS2834: Relative import paths 
need explicit file extensions in ECMAScript imports when '--moduleResolution' 
is 'node16' or 'nodenext'. Consider adding an extension to the import path.
   
   20 import * as echarts from './types/dist/echarts';
                               ~~~~~~~~~~~~~~~~~~~~~~
   
   node_modules/echarts/index.d.ts:23:1 - error TS1203: Export assignment 
cannot be used when targeting ECMAScript modules. Consider using 'export 
default' or another module format instead.
   
   23 export = echarts;
      ~~~~~~~~~~~~~~~~~
   
   src/named-import.ts:1:10 - error TS2305: Module '"echarts/charts"' has no 
exported member 'BarChart'.
   
   1 import { BarChart } from 'echarts/charts';
              ~~~~~~~~
   
   src/star-import.ts:1:26 - error TS2497: This module can only be referenced 
with ECMAScript imports/exports by turning on the 
'allowSyntheticDefaultImports' flag and referencing its default export.
   
   1 import * as echarts from 'echarts';
                              ~~~~~~~~~
   
   
   Found 5 errors in 4 files.
   ```
   
   ### Expected Behavior
   
   Given that I've followed the instructions on 
https://echarts.apache.org/handbook/en/basics/import/, I'd expect these imports 
to just work.
   
   ### Environment
   
   ```markdown
   - OS: macOS 15.6.1
   - Browser: N/A
   - Framework: N/A
   ```
   
   ### Any additional comments?
   
   https://arethetypeswrong.github.io/?p=echarts%406.0.0 indicates that there 
are a variety of issues with the TypeScript types.
   
   I noted that https://github.com/apache/echarts/issues/20554 seemingly 
describes a similar issue, but doesn't include a minimal reproduction and also 
was specifically for v5.X. I couldn't find an issue with a minimal reproduction 
that was for 6.X.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to