-
Notifications
You must be signed in to change notification settings - Fork 13k
Description
TypeScript Version: 3.7.3
Search Terms:
DirectoryWatcher, missing reference
Repro steps
- In Visual Studio, create a new ASP.NET Core Web Application with the Angular template.
- Open main.ts, expect to see to red squiggles under the two imports because the @types packages haven't yet been installed.
- Open package.json and save to trigger npm install.
- Once done, reopen main.ts.
Expected behavior:
Errors go away when NPM install finishes.
Actual behavior:
Errors remain, even when typing. Removing the typeRoots
setting in the tsconfig causes the errors to go away.
Also repros in VS Code
To reproduce in VS Code, create the same template using VS, but then open in VS code and npm install from the command line.
It seems like once the npm install finishes, the referenced files should be added to the project from some sort of watcher, but they're not until a change is made to the tsconfig. I imagine this is specifically related to the intended .d.ts files not being in the @types folder. I did confirm that this reproduces even without an explicit typeRoots setting.
Related Issues:
#14818