TSServer forgets module type declarations, when using project references #55135
Labels
Fix Available
A PR has been opened for this issue
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
Uh oh!
There was an error while loading. Please reload this page.
Type: Bug
On certain actions VS Code forgets the module declarations for modules it just knew seconds earlier, giving errors such as
Cannot find module 'package-a' or its corresponding type declarations. ts(2307)
. Building usingtsc --build
works without issues, so I assume the TSServer is the issue.The following repository demonstrates the problem in
packages/package-b/src/index.ts
:https://github.com/FunkMonkey/ts-language-server-bug
Steps to reproduce:
packages/package-b/src/index.ts
(no problems shown)import { FOO } from "package-a";
toimport { FOO } from "package-aX";
(shows an error about not finding type declarations, which is obviously correct)import { FOO } from "package-a";
Cannot find module 'package-a' or its corresponding type declarations. ts(2307)
, even after savingTypescript: Restart TS Server
package-a
are properly found againAdditional details:
d.ts
files, so it should properly find the the declarations (partially does that)bundler
and package.jsonexports
are usedVS Code version: Code 1.80.1 (74f6148eb9ea00507ec113ec51c489d6ffb4b771, 2023-07-12T17:22:07.651Z)
OS version: Windows_NT x64 10.0.19044
Modes:
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Extensions (39)
A/B Experiments
The text was updated successfully, but these errors were encountered: