Closed as not planned
Description
🔎 Search Terms
“module resolution dual references”
🕗 Version & Regression Information
- This changed between versions 4.9 and 5.0
- I was unable to test this on prior versions because `"moduleResolution": "bundler" was introduced in TypeScript 5.0.
⏯ Playground Link
https://github.com/remcohaszing/typescript-resolution-bug
💻 Code
See the repo. It’s not big, but it contains a bunch of small files that’s inconvenient and not useful to paste in the issue report.
Steps to reproduce:
git clone https://github.com/remcohaszing/typescript-resolution-bug.git
cd typescript-resolution-bug
npm install
npx tsc -b repro
🙁 Actual behavior
$ tsc -b repro
repro/test/test.ts:4:12 - error TS2345: Argument of type 'import("/home/remco/Projects/typescript-resolution-bug/repro/node_modules/some-lib/index").SomeType' is not assignable to parameter of type 'import("/home/remco/Projects/typescript-resolution-bug/repro/node_modules/some-lib/index").SomeType'.
Types have separate declarations of a private property 'property'.
4 myFunction(new SomeType())
~~~~~~~~~~~~~~
Found 1 error.
🙂 Expected behavior
One of the following:
- The reproduction is considered valid: does not contain type errors.
- The error shows the actual path of the resolved paths instead of stripping the file extension. Currently the paths in the error message are exactly the same. A nice side effect of this, is that the path becomes clickable in some terminal emulators.
Additional information about the issue
Removing references
from tsconfig.json
resolves the issue.
A real world example is found in https://github.com/remcohaszing/codemirror-languageservice. Just search for @ts-expect-error
.