Skip to content

"Project does not contain document" Error Causes Types to Stop Resolving in VS Code #38366

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

Closed
JasonGore opened this issue May 6, 2020 · 1 comment · Fixed by #38429
Closed
Assignees
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Fix Available A PR has been opened for this issue

Comments

@JasonGore
Copy link
Member

JasonGore commented May 6, 2020

TypeScript Version: 3.9.1-rc

Search Terms:
VS Code, Go to Definition, Go to Type Definition

Code

I'm not sure how to self-contain this, but within a given package I am:

  • Navigating to built-in class CustomDialog
  • Navigating to build-in interface CustomDialogProps (this navigation fails soon after TS Server restart)

Expected behavior:

Types defined within a given package are always navigable via VS Code.

Actual behavior:

I have an instance of navigating to type that works for a while after restarting TS server but then soon fails consistently. At some point navigation to a given type fails with the following error in the TS Server log. I am not sure why this error would occur given that the interface is defined and captured by the tsconfig.json and output into lib.

    Project 'G:/git/ooui-dd/packages/app-commanding-ui/tsconfig.json' does not contain document 'g:/git/ooui-dd/packages/app-commanding-ui/lib/UISurfaces/Dialog/Components/CustomDialog.d.ts'

    Error: Project 'G:/git/ooui-dd/packages/app-commanding-ui/tsconfig.json' does not contain document 'g:/git/ooui-dd/packages/app-commanding-ui/lib/UISurfaces/Dialog/Components/CustomDialog.d.ts'
        at Object.ThrowProjectDoesNotContainDocument (G:\git\ooui-dd\common\temp\node_modules\.pnpm\office.pkgs.visualstudio.com\typescript\3.9.1-rc\node_modules\typescript\lib\tsserver.js:141431:23)
        at ConfiguredProject.Project.getScriptInfoForNormalizedPath (G:\git\ooui-dd\common\temp\node_modules\.pnpm\office.pkgs.visualstudio.com\typescript\3.9.1-rc\node_modules\typescript\lib\tsserver.js:143467:42)
        at IOSession.Session.getApplicableRefactors (G:\git\ooui-dd\common\temp\node_modules\.pnpm\office.pkgs.visualstudio.com\typescript\3.9.1-rc\node_modules\typescript\lib\tsserver.js:149150:42)
        at Session.handlers.ts.createMapFromTemplate._a.<computed> (G:\git\ooui-dd\common\temp\node_modules\.pnpm\office.pkgs.visualstudio.com\typescript\3.9.1-rc\node_modules\typescript\lib\tsserver.js:147956:61)
        at G:\git\ooui-dd\common\temp\node_modules\.pnpm\office.pkgs.visualstudio.com\typescript\3.9.1-rc\node_modules\typescript\lib\tsserver.js:149451:88
        at IOSession.Session.executeWithRequestId (G:\git\ooui-dd\common\temp\node_modules\.pnpm\office.pkgs.visualstudio.com\typescript\3.9.1-rc\node_modules\typescript\lib\tsserver.js:149442:28)
        at IOSession.Session.executeCommand (G:\git\ooui-dd\common\temp\node_modules\.pnpm\office.pkgs.visualstudio.com\typescript\3.9.1-rc\node_modules\typescript\lib\tsserver.js:149451:33)
        at IOSession.Session.onMessage (G:\git\ooui-dd\common\temp\node_modules\.pnpm\office.pkgs.visualstudio.com\typescript\3.9.1-rc\node_modules\typescript\lib\tsserver.js:149475:35)
        at Interface.<anonymous> (G:\git\ooui-dd\common\temp\node_modules\.pnpm\office.pkgs.visualstudio.com\typescript\3.9.1-rc\node_modules\typescript\lib\tsserver.js:150791:27)
        at Interface.emit (events.js:203:13)
        at Interface._onLine (readline.js:316:10)
        at Interface._normalWrite (readline.js:461:12)
        at Socket.ondata (readline.js:172:10)
        at Socket.emit (events.js:203:13)
        at addChunk (_stream_readable.js:295:12)
        at readableAddChunk (_stream_readable.js:276:11)
        at Socket.Readable.push (_stream_readable.js:210:10)
        at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)

Playground Link:

I'm not sure how to replicate this kind of issue in Playground, but I do have a local repro that I can get to trigger consistently. I also have TS Server logs I can provide privately.

Related Issues:

I tried searching issues for "Go to definition" and didn't see anything applicable. @DanielRosenwasser if there are any further steps I can take to help, please let me know!

@JasonGore JasonGore changed the title Types stop Resolving in VS Code Types Stop Resolving in VS Code May 6, 2020
@DanielRosenwasser DanielRosenwasser changed the title Types Stop Resolving in VS Code "Project does not contain document" Error Causes Types to Stop Resolving in VS Code May 6, 2020
@sheetalkamat sheetalkamat self-assigned this May 8, 2020
sheetalkamat added a commit that referenced this issue May 8, 2020
…ject but not part of default configured project (eg because its output of that projet)

Fixes #38366
@sheetalkamat sheetalkamat added Bug A bug in TypeScript Fix Available A PR has been opened for this issue Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output labels May 8, 2020
typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this issue May 8, 2020
Component commits:
6e3c1d1 Fix detecting default project when file is part for more than one project but not part of default configured project (eg because its output of that projet) Fixes microsoft#38366
sheetalkamat added a commit that referenced this issue May 12, 2020
…ject but not part of default configured project (eg because its output of that projet) (#38429)

Fixes #38366
sheetalkamat added a commit that referenced this issue May 12, 2020
Component commits:
6e3c1d1 Fix detecting default project when file is part for more than one project but not part of default configured project (eg because its output of that projet) Fixes #38366

Co-authored-by: Sheetal Nandi <[email protected]>
@DanielRosenwasser
Copy link
Member

Should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Fix Available A PR has been opened for this issue
Projects
None yet
3 participants