VS Code/language server doesn't properly detect NodeNext
module kind based on package.json
#47806
Labels
NodeNext
module kind based on package.json
#47806
Bug Report
🔎 Search Terms
typescript nodenext errors only reported by tsc
typescript nodenext errors not reported by vs code
🕗 Version & Regression Information
I noticed this in
4.6.0-dev.20220208
and didn't try earlier versions because theNodeNext
module kind hasn't been included in a stable release yet.⏯ Playground Link
Can't be reproduced in the Playground.
💻 Code
Reproducing the bug doesn't require specific code, but rather a specific TypeScript and VS Code setup, so I created a reproduction repo. Here's what's necessary to reproduce the issue:
4.6.0-dev.20220208
)yarn tsc
ornpx tsc
src/index.ts
file in VS Code🙁 Actual behavior
tsc
tells us about the ESM-specificRelative import paths need explicit file extensions...
error insrc/index.ts
while VS Code doesn't. This is likely becausetsc
correctly detects the file's module kind to beNodeNext
based on thepackage.json
while the language server doesn't for some reason.🙂 Expected behavior
Both
tsc
and VS Code report the error because they both realize that the file is aNodeNext
module.The text was updated successfully, but these errors were encountered: