Skip to content

[3.7.2] Debug failure: Dynamic files must always have current directory context #35094

Closed
@mjbvz

Description

@mjbvz

Extracted from microsoft/vscode#84618 (comment)

TypeScript Version: 3.7.2

Search Terms

  • Update Open
  • updateOpen
  • untitled
  • VS Code

Problem
@MLoughry is reporting TS Server errors in VS Code for loose JS files (untitled files). Here are the relevant parts of the logs:

Info 0    [16:30:41.124] Starting TS Server
Info 1    [16:30:41.128] Version: 3.7.2
Info 2    [16:30:41.128] Arguments: C:\Program Files\Microsoft VS Code\Code.exe e:\VSO\client-web\node_modules\typescript\lib\tsserver.js --syntaxOnly --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName C:\Users\Michael\AppData\Local\Temp\vscode-typescript\6b5bad2d31e523852b49\tscancellation-0a9a8159919f74576a36.tmp* --logVerbosity verbose --logFile c:\Users\Michael\AppData\Roaming\Code\logs\20191109T200605\exthost3\vscode.typescript-language-features\tsserver-log-BSEZoJ\tsserver.log --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation
Info 3    [16:30:41.128] Platform: win32 NodeVersion: 12 CaseSensitive: false
Info 4    [16:30:41.136] request:
    {"seq":0,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"untitled:/e:/VSO/client-web/fooScript.js","fileContent":"cons","projectRootPath":"e:\\VSO\\client-web","scriptKindName":"JS"}]}}
Info 5    [16:30:41.141] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Info 6    [16:30:41.141] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 1 structureChanged: undefined Elapsed: 0ms
Info 7    [16:30:41.141] Project '/dev/null/inferredProject1*' (Inferred) 
Info 8    [16:30:41.141] 	Files (0)

Info 9    [16:30:41.141] -----------------------------------------------
Info 10   [16:30:41.141] Project '/dev/null/inferredProject1*' (Inferred) 0
Info 10   [16:30:41.141] 	Files (0)

Info 10   [16:30:41.141] -----------------------------------------------
Info 10   [16:30:41.141] Open files: 
Info 10   [16:30:41.141] 	FileName: untitled:/e:/VSO/client-web/fooScript.js ProjectRootPath: e:/VSO/client-web
Info 10   [16:30:41.141] 		Projects: /dev/null/inferredProject1*
Perf 10   [16:30:41.142] 0::updateOpen: elapsed time (in milliseconds) 5.8480
Info 11   [16:30:41.142] response:
    {"seq":0,"type":"response","command":"updateOpen","request_seq":0,"success":true,"body":true}
Info 12   [16:30:41.143] request:
    {"seq":1,"type":"request","command":"configure","arguments":{"hostInfo":"vscode","preferences":{"providePrefixAndSuffixTextForRename":true,"allowRenameOfImportPath":true}}}
Info 13   [16:30:41.143] Host information vscode
Info 14   [16:30:41.143] response:
    {"seq":0,"type":"response","command":"configure","request_seq":1,"success":true}
Perf 15   [16:30:41.143] 1::configure: async elapsed time (in milliseconds) 0.3943
Info 16   [16:30:41.143] request:
    {"seq":2,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"e:/VSO/client-web/packages/mail/packages/attachments/orchestration/owa-attachment-multi-menu-actions/lib/test.ts","fileContent":"import { AttachmentMenuInfo } from '.';\n","projectRootPath":"e:\\VSO\\client-web","scriptKindName":"TS"},{"file":"e:/VSO/client-web/packages/mail/packages/attachments/orchestration/owa-attachment-multi-menu-actions/lib/index.ts","fileContent":"export {\r\n    default as AttachmentMenuInfo,\r\n    GetCreateAttachmentHandlerFunc,\r\n} from './types/AttachmentMenuInfo';\r\nexport { default as AttachmentMultiMenuEntry } from './types/AttachmentMultiMenuEntry';\r\nexport { CreateAttachmentsFunc } from './types/CreateAttachmentsFunc';\r\n\r\nexport { default as attachmentMultiMenuEntry } from './utils/attachmentMultiMenuEntry';\r\n","projectRootPath":"e:\\VSO\\client-web","scriptKindName":"TS"},{"file":"untitled:/e:/VSO/client-web/^fooScript.js","fileContent":"cons","projectRootPath":"e:\\VSO\\client-web","scriptKindName":"JS"}]}}
Err 17    [16:30:41.160] Exception on executing command {"seq":2,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"e:/VSO/client-web/packages/mail/packages/attachments/orchestration/owa-attachment-multi-menu-actions/lib/test.ts","fileContent":"import { AttachmentMenuInfo } from '.';\n","projectRootPath":"e:\\VSO\\client-web","scriptKindName":"TS"},{"file":"e:/VSO/client-web/packages/mail/packages/attachments/orchestration/owa-attachment-multi-menu-actions/lib/index.ts","fileContent":"export {\r\n    default as AttachmentMenuInfo,\r\n    GetCreateAttachmentHandlerFunc,\r\n} from './types/AttachmentMenuInfo';\r\nexport { default as AttachmentMultiMenuEntry } from './types/AttachmentMultiMenuEntry';\r\nexport { CreateAttachmentsFunc } from './types/CreateAttachmentsFunc';\r\n\r\nexport { default as attachmentMultiMenuEntry } from './utils/attachmentMultiMenuEntry';\r\n","projectRootPath":"e:\\VSO\\client-web","scriptKindName":"TS"},{"file":"untitled:/e:/VSO/client-web/^fooScript.js","fileContent":"cons","projectRootPath":"e:\\VSO\\client-web","scriptKindName":"JS"}]}}:

    Debug Failure. False expression: 
    Verbose Debug Information: {"fileName":"untitled:/e:/VSO/client-web/^fooScript.js","currentDirectory":"e:/VSO/client-web","hostCurrentDirectory":"C:/Program Files/Microsoft VS Code","openKeys":["untitled:/e:/vso/client-web/fooscript.js"]}
    Dynamic files must always have current directory context since containing external project name will always match the script info name.

    Error: Debug Failure. False expression: 
    Verbose Debug Information: {"fileName":"untitled:/e:/VSO/client-web/^fooScript.js","currentDirectory":"e:/VSO/client-web","hostCurrentDirectory":"C:/Program Files/Microsoft VS Code","openKeys":["untitled:/e:/vso/client-web/fooscript.js"]}
    Dynamic files must always have current directory context since containing external project name will always match the script info name.
        at ProjectService.getOrCreateScriptInfoWorker (e:\VSO\client-web\node_modules\typescript\lib\tsserver.js:137724:30)
        at ProjectService.getOrCreateScriptInfoOpenedByClientForNormalizedPath (e:\VSO\client-web\node_modules\typescript\lib\tsserver.js:137710:29)
        at ProjectService.getOrCreateOpenScriptInfo (e:\VSO\client-web\node_modules\typescript\lib\tsserver.js:138113:33)
        at ProjectService.applyChangesInOpenFiles (e:\VSO\client-web\node_modules\typescript\lib\tsserver.js:138332:41)
        at Session.handlers.ts.createMapFromTemplate._a.<computed> (e:\VSO\client-web\node_modules\typescript\lib\tsserver.js:139212:46)
        at e:\VSO\client-web\node_modules\typescript\lib\tsserver.js:140870:88
        at IOSession.Session.executeWithRequestId (e:\VSO\client-web\node_modules\typescript\lib\tsserver.js:140861:28)
        at IOSession.Session.executeCommand (e:\VSO\client-web\node_modules\typescript\lib\tsserver.js:140870:33)
        at IOSession.Session.onMessage (e:\VSO\client-web\node_modules\typescript\lib\tsserver.js:140893:35)
        at Interface.<anonymous> (e:\VSO\client-web\node_modules\typescript\lib\tsserver.js:142208:27)
        at Interface.emit (events.js:200:13)
        at Interface._onLine (readline.js:314:10)
        at Interface._normalWrite (readline.js:459:12)
        at Socket.ondata (readline.js:170:10)
        at Socket.emit (events.js:200:13)
        at addChunk (_stream_readable.js:294:12)
        at readableAddChunk (_stream_readable.js:275:11)
        at Socket.Readable.push (_stream_readable.js:210:10)
        at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)

The crash has similar repo steps but has a different error stack from #35091

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions