-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Typescript service is often stopping working randomly: Cannot read property 'charCount' of undefined #16456
Comments
Looks like the first failure is:
(The cancelled requests ones are from vscode and not really errors. I've fixed the logging of these in the current vscode insiders builds) |
Hi @asvetliakov, what we can tell from the log is that the server is somehow getting into a bad state where the contents of a source file are out-of-sync with line/column information. But we don't know how it got into that state. The attatched log doesn't seem to begin from the launch of the tsserver; that would be indicated if it started like:
Would you be able to get a complete log from the start? |
@Andy-MS Just sent full trace log to your email |
Hi @asvetliakov, that looks like a different log file that what we were expecting. |
@asvetliakov Thanks, that looks like the correct one. |
I'm having this issue too, do you need additional logs? |
Thanks, we've already reproduced the error. |
@asvetliakov We noticed the following on line 17 of the log you sent us:
Could you check that your file system is case-sensitive? I've adapted the code we use to test for this, so you can put it in any const os = require("os");
const fs = require("fs");
function fileExists(path) {
try {
const stat = fs.statSync(path);
return stat.isFile();
}
catch (e) {
return false;
}
}
function isFileSystemCaseSensitive() {
const platform = os.platform();
// win32\win64 are case insensitive platforms
if (platform === "win32" || platform === "win64") {
return false;
}
// convert current file name to upper case / lower case and check if file exists
// (guards against cases when name is already all uppercase or lowercase)
return !fileExists(__filename.toUpperCase()) || !fileExists(__filename.toLowerCase());
}
console.log(isFileSystemCaseSensitive()); @Pajn Could you check for something similar, or send us your logs too? |
No, my file system is case-insensitive. Your code gives |
@asvetliakov Could you share your |
@Andy-MS {
"compilerOptions": {
"strict": true,
"strictNullChecks": true,
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"noEmitOnError": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"types": [
"node",
"jest"
],
"noUnusedLocals": true,
"outDir": "./compiled",
"typeRoots": [
"types",
"node_modules/@types"
],
"baseUrl": ".",
"paths": {
"*": [
"types/*"
]
}
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"compiled"
]
} Also, looks like i can't reproduce it now with the new version of vscode 1.14, so may be error came from vscode side, as i didn't have any problems with version 1.12 too. Should i try to capture logs from vscode 1.13? |
Hi @asvetliakov , I think at this point the specific error we are looking for is when both a Also of note, our watcher for "/users" does somehow seem to be getting fired, which is how we end up with duplicate files. The only file that is giving us problems is named We also seem to be getting vscode some "open" events for lower-case "users", although only after we send it a "configFileDiag" event. (Since apparently we consider the tsconfig for @sheetalkamat Is also refactoring our watch implementation so she might have insight into how we ended up watching a lower-case directory. |
Based on discussion with @sheetalkamat this may be solved by the new watch implementation. |
Still have multiple
No. Both |
I'm sorry for not coming back sooner. |
…e and non sensitive file system and fixing caching
…e and non sensitive file system and fixing caching
I am not sure if my problem is exactly the same, but after having added some new files in the project, tsc began to crash with :
Tsc : 2.5.1 and 2.6.0-dev.20170829 I can provide ts server log if need be. |
Can you please give a try to typescript@next to see if this works. I believe this with merge of PR #17669 |
I haven't seen the issue any more after upgrading to 2.5.2 |
For posterity, I'm still seeing the "Debug Failure. False expression. at computePositionOfLineAndCharacter" error with 2.5.3 on OSX Sierra, but the problem is fixed in typescript@next so I'm not opening a new issue. |
From @asvetliakov on June 12, 2017 16:40
May be related to #28112
I'm not sure how to reproduce it yet. It seems to happen randomly and VERY often.
Steps:
2.1. The validation messages are incorrect and have incorrect location
2.2. Completion and navigation features stops working
Typescript version: 2.3.3, also i didn't have any issues with vscode 1.12.0
I'm getting this in typescript service output:
Full log: https://pastebin.com/X6xpSR1z
Thanks
Copied from original issue: microsoft/vscode#28543
The text was updated successfully, but these errors were encountered: