Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors from missing references to non-@types .d.ts files do not disappear after npm install #35966

Closed
uniqueiniquity opened this issue Jan 2, 2020 · 0 comments · Fixed by #36039
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@uniqueiniquity
Copy link
Contributor

TypeScript Version: 3.7.3

Search Terms:
DirectoryWatcher, missing reference

Repro steps

  1. In Visual Studio, create a new ASP.NET Core Web Application with the Angular template.
  2. Open main.ts, expect to see to red squiggles under the two imports because the @types packages haven't yet been installed.
  3. Open package.json and save to trigger npm install.
  4. 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

@sheetalkamat sheetalkamat self-assigned this Jan 3, 2020
sheetalkamat added a commit that referenced this issue Jan 6, 2020
…g complete node_modules, so that npm install is reflected correctly

Fixes #35966
@sheetalkamat sheetalkamat added the Bug A bug in TypeScript label Jan 6, 2020
@sheetalkamat sheetalkamat added this to the TypeScript 3.8.0 milestone Jan 6, 2020
@sheetalkamat sheetalkamat added the Fix Available A PR has been opened for this issue label Jan 7, 2020
sheetalkamat added a commit that referenced this issue Jan 10, 2020
…g complete node_modules, so that npm install is reflected correctly (#36039)

* Add test that demonstrates npm install watch behaviour some times

* Use watch invoked with `node_modules/.staging` as watch for refreshing complete node_modules, so that npm install is reflected correctly
Fixes #35966
Kingwl pushed a commit to Kingwl/TypeScript that referenced this issue Mar 4, 2020
…g complete node_modules, so that npm install is reflected correctly (microsoft#36039)

* Add test that demonstrates npm install watch behaviour some times

* Use watch invoked with `node_modules/.staging` as watch for refreshing complete node_modules, so that npm install is reflected correctly
Fixes microsoft#35966
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
3 participants