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

   ### Version
   
   5.5.0
   
   ### Link to Minimal Reproduction
   
   https://github.com/eavidy/test_case/tree/echart-1
   
   ### Steps to Reproduce
   
   
   
   
   1.  Clone Repository  `git clone -b echart-1 
[email protected]:eavidy/test_case.git`
   This example mainly includes two files
    tsconfig.json:
   ```json
   {
     "compilerOptions": {
       "module": "NodeNext",
       "moduleResolution": "NodeNext",
       "strict": true
     },
     "exclude": ["node_modules"]
   }
   
   ```
   
   main.mts :
   ```
   import { init } from "echarts";
   
   ```
   2. Execute commands in the project directory 
   `npm install`
   `tsc --noEmit`
   
   ### Current Behavior
   
   `tsc --noEmit` output:
   ```
   main.mts:1:10 - error TS2305: Module '"echarts/core"' has no exported member 
'init'.
   
   1 import { init } from "echarts/core";
              ~~~~
   
   node_modules/echarts/core.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/core';
                    ~~~~~~~~~~~~~~~~~~~
   
   
   Found 2 errors in 2 files.
   
   Errors  Files
        1  main.mts:1
        1  node_modules/echarts/core.d.ts:20
   ```
   vscode:
   
![image](https://github.com/apache/echarts/assets/73151139/1b8534a1-da1f-4d4c-a5d8-17b63e7e054d)
   
   
   ### Expected Behavior
   
   Setting module and moduleResolution to CommonJs and node respectively can 
work properly
   ```ts
   {
     "compilerOptions": {
       "module": "CommonJS",
       "moduleResolution": "Node",
       "strict": true
     },
     "exclude": ["node_modules"]
   }
   
   ```
   
![image](https://github.com/apache/echarts/assets/73151139/920686ce-78e4-4470-9243-6225d0831202)
   
   
   Can the NodeNext module for Typescript be supported?
   
   ### Environment
   
   ```markdown
   - OS: Mac OS
   - Browser:
   - Framework:
   - typescript: 5.4.5
   ```
   
   
   ### Any additional comments?
   
   _No response_


-- 
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