[Bug] Typescript setting module to "NodeNext" cannot obtain type prompt
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
### 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 git@github.com: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/core";
```
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:

### 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"]
}
```

Can the NodeNext module for Typescript be supported?
### Environment
```markdown
- OS: Mac OS
- Browser:
- Framework:
- typescript: 5.4.5
```
### Any additional comments?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.