Closed KathyDinh closed 7 years ago
@kieferrm @waderyan @mjbvz please let me know if you plan on doing something about it for 1.8.1 recovery release on Monday, otherwise we should push it out to January.
@KathyDinh any additional information you can provide? Could we potentially get access to the typescript project? Any error message you see in the typescript output log?
//cc @dbaeumer
@bpasero We've seen a few reports of problems with JS and TS but do not have enough information to investigate.
@KathyDinh: Along with providing an example project, can you please:
"typescript.tsserver.trace": "verbose"
TypeScript
tab in the output pane and share the results from there.Thanks
Instead of going back to VS Code version 1.7 you could also use the typescript.tsdk setting to point VS Code 1.8 to a different TS version. To use for example 2.0.10 (which shipped with 1.7) do the following:
"typescript.tsdk":"./node_modules/typescript/lib"
Since we can't reproduce the problem with our test workspaces would any of you be able to share your workspace using GitHub so that we can investigate why TS is not working for you?
Hi! I'm having a similar problem with VS Code Version 1.8.1, OS X 10.11.6 (El Capitan) with all extensions disabled + just the default settings, apart from "typescript.tsserver.trace": "verbose"
. In VS Code 1.7.2 everything works fine!
Can't unfortunately share the codebase, but I managed to narrow problem down to the jsconfig.json
configuration.
Removing jsconfig.json
completely, or using the following contents works fine:
{
"compilerOptions": {
"target": "es6"
},
"exclude": [
"node_modules"
]
}
but adding the "module": "commonjs"
flag breaks the JS support.
{
"compilerOptions": {
"target": "es6",
"module": "commonjs"
},
"exclude": [
"node_modules"
]
}
Here is the output from the typescript trace log. Please let me know if I can do any additional steps to help figure this out!
[Trace - 13.18.24] Sending request: configure (0). Response expected: yes. Current queue length: 0
Arguments: {}
[Trace - 13.18.24] Response received: configure (0). Request took 173 ms. Success: true
[Trace - 13.18.24] Sending request: compilerOptionsForInferredProjects (1). Response expected: yes. Current queue length: 1
Arguments: {}
[Trace - 13.18.24] Response received: compilerOptionsForInferredProjects (1). Request took 174 ms. Success: true
Result: true
[Trace - 13.18.24] Sending request: open (2). Response expected: no. Current queue length: 0
Arguments: {}
[Trace - 13.18.24] Sending request: geterr (3). Response expected: no. Current queue length: 0
Arguments: {}
[Trace - 13.18.25] Sending request: quickinfo (4). Response expected: yes. Current queue length: 0
Arguments: {}
[Trace - 13.18.26] TypeScript Service: tried to cancel request with sequence number 4. But request got already delivered.
[Trace - 13.18.26] Response received: quickinfo (4). Request took 1081 ms. Success: false . Message: Error processing request. Cannot read property 'getSourceFiles' of undefined
TypeError: Cannot read property 'getSourceFiles' of undefined
at ConfiguredProject.Project.getScriptInfos (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65132:43)
at ModuleBuilder.ensureProjectDependencyGraphUpToDate (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:64701:59)
at ModuleBuilder.onProjectUpdateGraph (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:64696:22)
at ConfiguredProject.Project.updateGraphWorker (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65303:30)
at ConfiguredProject.Project.updateGraph (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65251:39)
at ConfiguredProject.Project.getLanguageService (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65038:26)
at IOSession.Session.getQuickInfoWorker (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:67665:41)
at Session.handlers.ts.createMap._a.(anonymous function) (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:66933:61)
at IOSession.Session.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:68120:28)
at IOSession.Session.onMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:68140:35)
[Trace - 13.18.26] Sending request: occurrences (5). Response expected: yes. Current queue length: 0
Arguments: {}
[Trace - 13.18.26] Response received: occurrences (5). Request took 93 ms. Success: false . Message: Error processing request. Cannot read property 'getSourceFiles' of undefined
TypeError: Cannot read property 'getSourceFiles' of undefined
at ConfiguredProject.Project.getScriptInfos (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65132:43)
at ModuleBuilder.ensureProjectDependencyGraphUpToDate (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:64701:59)
at ModuleBuilder.onProjectUpdateGraph (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:64696:22)
at ConfiguredProject.Project.updateGraphWorker (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65303:30)
at ConfiguredProject.Project.updateGraph (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65251:39)
at ConfiguredProject.Project.getLanguageService (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65038:26)
at IOSession.Session.getOccurrences (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:67371:43)
at Session.handlers.ts.createMap._a.(anonymous function) (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:67067:61)
at IOSession.Session.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:68120:28)
at IOSession.Session.onMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:68140:35)
[Error - 13.18.26] 'occurrences' request failed with error.
Error processing request. Cannot read property 'getSourceFiles' of undefined
TypeError: Cannot read property 'getSourceFiles' of undefined
at ConfiguredProject.Project.getScriptInfos (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65132:43)
at ModuleBuilder.ensureProjectDependencyGraphUpToDate (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:64701:59)
at ModuleBuilder.onProjectUpdateGraph (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:64696:22)
at ConfiguredProject.Project.updateGraphWorker (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65303:30)
at ConfiguredProject.Project.updateGraph (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65251:39)
at ConfiguredProject.Project.getLanguageService (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:65038:26)
at IOSession.Session.getOccurrences (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:67371:43)
at Session.handlers.ts.createMap._a.(anonymous function) (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:67067:61)
at IOSession.Session.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:68120:28)
at IOSession.Session.onMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript/node_modules/typescript/lib/tsserver.js:68140:35)
This is interesting... Thanks for tracking this down @codeflows.
@dbaeumer @mhegazy can you take a look at this log? Any idea why "commonjs"
would cause this behavior.
Hi.
Unfortunately, I am not allowed to share my TypeScript Project either. I have followed @mjbvz instruction and my TypeScript trace log looks similar to @codeflows.
I have tried to remove most of the settings in tsconfig.json like what @codeflows did:
{
"compilerOptions": {
"target": "es5"
},
"exclude": [
"node_modules"
]
}
However, Intellisense is still not working and trace log produces same error
[Info - 12:30:10 PM] Using tsserver from location: c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js
[Trace - 12:30:10 PM] Sending request: configure (0). Response expected: yes. Current queue length: 0
Arguments: {}
[Trace - 12:30:10 PM] TypeScript Service: canceled request with sequence number 3
[Trace - 12:30:11 PM] Response received: configure (0). Request took 532 ms. Success: true
[Trace - 12:30:11 PM] Sending request: compilerOptionsForInferredProjects (1). Response expected: yes. Current queue length: 3
Arguments: {}
[Trace - 12:30:11 PM] Response received: compilerOptionsForInferredProjects (1). Request took 532 ms. Success: true
Result: true
[Trace - 12:30:11 PM] Sending request: open (2). Response expected: no. Current queue length: 2
Arguments: {}
[Trace - 12:30:11 PM] Sending request: occurrences (4). Response expected: yes. Current queue length: 1
Arguments: {}
[Trace - 12:30:11 PM] TypeScript Service: canceled request with sequence number 6
[Trace - 12:30:12 PM] Response received: occurrences (4). Request took 1145 ms. Success: false . Message: Error processing request. Cannot read property 'getSourceFiles' of undefined
TypeError: Cannot read property 'getSourceFiles' of undefined
at ConfiguredProject.Project.getScriptInfos (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65132:43)
at ModuleBuilder.ensureProjectDependencyGraphUpToDate (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:64701:59)
at ModuleBuilder.onProjectUpdateGraph (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:64696:22)
at ConfiguredProject.Project.updateGraphWorker (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65303:30)
at ConfiguredProject.Project.updateGraph (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65251:39)
at ConfiguredProject.Project.getLanguageService (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65038:26)
at IOSession.Session.getOccurrences (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:67371:43)
at Session.handlers.ts.createMap._a.(anonymous function) (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:67067:61)
at IOSession.Session.executeCommand (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:68120:28)
at IOSession.Session.onMessage (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:68140:35)
[Trace - 12:30:12 PM] Sending request: geterr (5). Response expected: no. Current queue length: 0
Arguments: {}
[Error - 12:30:12 PM] 'occurrences' request failed with error.
Error processing request. Cannot read property 'getSourceFiles' of undefined
TypeError: Cannot read property 'getSourceFiles' of undefined
at ConfiguredProject.Project.getScriptInfos (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65132:43)
at ModuleBuilder.ensureProjectDependencyGraphUpToDate (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:64701:59)
at ModuleBuilder.onProjectUpdateGraph (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:64696:22)
at ConfiguredProject.Project.updateGraphWorker (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65303:30)
at ConfiguredProject.Project.updateGraph (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65251:39)
at ConfiguredProject.Project.getLanguageService (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65038:26)
at IOSession.Session.getOccurrences (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:67371:43)
at Session.handlers.ts.createMap._a.(anonymous function) (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:67067:61)
at IOSession.Session.executeCommand (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:68120:28)
at IOSession.Session.onMessage (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:68140:35)
[Trace - 12:30:12 PM] Sending request: references (7). Response expected: yes. Current queue length: 0
Arguments: {}
[Trace - 12:30:12 PM] Response received: references (7). Request took 1 ms. Success: false . Message: Error processing request. Cannot read property 'getSourceFiles' of undefined
TypeError: Cannot read property 'getSourceFiles' of undefined
at ConfiguredProject.Project.getScriptInfos (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65132:43)
at ModuleBuilder.ensureProjectDependencyGraphUpToDate (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:64701:59)
at ModuleBuilder.onProjectUpdateGraph (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:64696:22)
at ConfiguredProject.Project.updateGraphWorker (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65303:30)
at ConfiguredProject.Project.updateGraph (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65251:39)
at ConfiguredProject.Project.getLanguageService (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65038:26)
at IOSession.Session.getReferences (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:67551:51)
at Session.handlers.ts.createMap._a.(anonymous function) (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:66914:61)
at IOSession.Session.executeCommand (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:68120:28)
at IOSession.Session.onMessage (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:68140:35)
[Error - 12:30:12 PM] 'references' request failed with error.
Error processing request. Cannot read property 'getSourceFiles' of undefined
TypeError: Cannot read property 'getSourceFiles' of undefined
at ConfiguredProject.Project.getScriptInfos (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65132:43)
at ModuleBuilder.ensureProjectDependencyGraphUpToDate (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:64701:59)
at ModuleBuilder.onProjectUpdateGraph (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:64696:22)
at ConfiguredProject.Project.updateGraphWorker (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65303:30)
at ConfiguredProject.Project.updateGraph (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65251:39)
at ConfiguredProject.Project.getLanguageService (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:65038:26)
at IOSession.Session.getReferences (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:67551:51)
at Session.handlers.ts.createMap._a.(anonymous function) (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:66914:61)
at IOSession.Session.executeCommand (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:68120:28)
at IOSession.Session.onMessage (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\typescript\node_modules\typescript\lib\tsserver.js:68140:35)
I tried @dbaeumer suggestion. Intellisense is back and working.
Looks like a TS bug. @KathyDinh can you share the full log? Or a sample project? Also do you see the same behavior with 'typescript@next'?
@waderyan we should probable move this to the TS issue tracker.
Аnd what to do with javascript intellisense ? On older version it work but on 1.8.1 not. On some projects V8 build in application and i don`t use node ecosystem On 1.6.1 works on file.js:
class Foo {
}
class Foo2 extends Foo {
}
but now intellisense does not works :(
@buzzzzer you can use VS Code 1.8.1 with TS 2.0.10 using the instructions provided here: https://github.com/Microsoft/vscode/issues/17221#issuecomment-267932516
@dbaeumer Works. This is a temporary solution?
this looks like a duplicate of https://github.com/Microsoft/TypeScript/issues/12976. can you try typescript@next
or try VSCode insiders?
@buzzzzer yes, this is a temporary solution to fix the issue. However it might be good practice to use the setting to ensure you don't get new TS version if you don't want to.
Observation: Hi. I neither use Typescript nor Javascript at the moment. But I do some HTML coding and today I upgraded to lastest VS code. I tried to use the Exension 'Preview'. But when I tried to invoke this Extension I only got the error 'Unable to open '\Preview: 'project.html'': Cannot read property 'document' of undefined.' While trying to figure out what caused this error, I stumbled upon this issue. I tried @codeflows workaroud, commented out the commonjs module and restarted VS code. From that moment on Preview worked again. So maybe the problem goes deeper. This is my now working jsconfig.json file: ` { "compilerOptions": { "target": "es6",
// "module": "commonjs",
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules",
"bower_components",
"jspm_packages",
"tmp",
"temp"
]
} `
@aeschli can you please comment on @richardk2016
@richardk2016 The vscode built-in HTML support does not have a preview. VS Code only provides that for Markdown. Are you using an extension from the market place? If yes, file an issue against that extension. Otherwise please file a new bug against this repo, with detailed steps
Closing as a duplicate of Microsoft/TypeScript#12976
Please try out the latest VSCode insiders builds to pick up the fix. As @dbaeumer and others have suggested, you can also install TS 2.1.5 locally with npm install typescript@2.1.5
and use the setting "typescript.tsdk": "./node_modules/typescript/lib" to use this version. Let us know if you still see this issue after updating.
@mjbvz, @dbaeumer
vscode build from source today. Intellisense on js still does not work.
Trying install locally typescript, typescript@2.1.5, typescript@next
with "typescript.tsdk": "./node_modules/typescript/lib" in workspace settings, and without typescript.tsdk
TypeScript output:
[Info - 10:55:18] Using tsserver from location: d:\sample\node_modules\typescript\lib\tsserver.js
[Error - 10:55:21] 'quickinfo' request failed with error.
Error processing request. Cannot read property 'getSourceFiles' of undefined
TypeError: Cannot read property 'getSourceFiles' of undefined
at ConfiguredProject.Project.updateGraph (d:\sample\node_modules\typescript\lib\tsserver.js:65745:55)
at ConfiguredProject.Project.getLanguageService (d:\sample\node_modules\typescript\lib\tsserver.js:65520:26)
at IOSession.Session.getQuickInfoWorker (d:\sample\node_modules\typescript\lib\tsserver.js:68202:41)
at Session.handlers.ts.createMap._a.(anonymous function) (d:\sample\node_modules\typescript\lib\tsserver.js:67470:61)
at IOSession.Session.executeCommand (d:\sample\node_modules\typescript\lib\tsserver.js:68661:28)
at IOSession.Session.onMessage (d:\sample\node_modules\typescript\lib\tsserver.js:68681:35)
at Interface.<anonymous> (d:\sample\node_modules\typescript\lib\tsserver.js:69833:27)
at emitOne (events.js:96:13)
at Interface.emit (events.js:188:7)
at Interface._onLine (readline.js:232:10)
[Error - 10:55:21] 'definition' request failed with error.
Error processing request. Cannot read property 'getSourceFiles' of undefined
TypeError: Cannot read property 'getSourceFiles' of undefined
work ony with typescript@2.0.10
@buzzzzer are you able to share your workspace so that we can investigate.
@dbaeumer yes. of course how ?
@dbaeumer I found the reason, but I do not know it is an error or not.
Workspace has a subdirectory with devtools-frontend (not in node_modules)
In .vscode\settings.json "devtools-frontend folder" add to "files.exclude", but on jsconfig.json was not. After adding to jsconfig exclude all works fine.
@buzzzzer Can you put it on GitHub?
@dbaeumer https://github.com/buzzzzer/sample-for-vscode
open src/test.js
Thanks @buzzzzer. Reproduces nicely.
This is again an issue in the tsserver. Opened https://github.com/Microsoft/TypeScript/issues/13698
I will close the issue again since this needs to be track in TS land
Hi,
I just updated vscode to latest version this morning. The project I am working on is in TypeScript. After the update, the Intellisense does not work anymore and the funtionalities like Go to Definition, Peek Definition, Find All References, Rename symbols no longer work. No matter whether I use keyboard shortcut or select in context menu, they return "No results" or nothing happens at all. For now, I have downgraded to previous version