Description
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 the NodeNext
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:
- Clone the repo
- Install the dependencies
- Open the project in VS Code
- Make VS Code use the workspace TypeScript version (
4.6.0-dev.20220208
) - Compile the code with
yarn tsc
ornpx tsc
- Open the
src/index.ts
file in VS Code
π Actual behavior
tsc
tells us about the ESM-specific Relative import paths need explicit file extensions...
error in src/index.ts
while VS Code doesn't. This is likely because tsc
correctly detects the file's module kind to be NodeNext
based on the package.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 a NodeNext
module.