-
Notifications
You must be signed in to change notification settings - Fork 167
Server error "Could not find source file" on opening second file in a project with large amount of code #803
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
Comments
Can you post the output that you get when running your script? I'd like to see when the responses arrive in your case. (note that I haven't been able to reproduce on doing a quick test) |
Ah yep, sure, here is the full output of a run:
Note I also had trouble reproducing it with the original script after a restart. I fiddled a bit with some of the numbers and re-copied the commands from my editor session and now I'm able to reproduce it again, the script is now this (apart from changing the timeout and the number & sizes of the files, I suspect the only other change is the ordering of the JSON dictionary parameters but I am not certain) It's now this:
|
I could reproduce the error and while I haven't dug into the root of the problem (it looks like a Typescript issue and I'm not paid to solve its issues ;)), I've noticed that the language server is crashing due to unhandled exception on tsserver error. This doesn't happen in VSCode because it seems to have a global handler for unhandled exceptions. Thus I've made a fix (#805) that will make it so that tsserver errors will not crash the process but the error will still be there technically. I can also reproduce the code lens resolve request triggering a tsserver error in VSCode so it's not a problem that is specific to this project. |
I'm not sure if this solution is satisfying for you but as I said, I'm not really willing to dig into Typescript unless someone pays me to do that. :) It could be reported against TypeScript repo but since reproduction relies on a standalone script and this server, they will likely dismiss it as a third-party issue. If you can find a way to reproduce reliably in VSCode then that would be looked at with more priority by them then. As I said, I can reproduce code lens resolving failing with "No Project" error in VSCode but that's not exactly the same issue as you've seen. |
In a project with about 20MB of Javascript / Typescript code, opening the second file will reliably trigger an error looking like this:
even though the file exists.
In my case this size of code existed because we had a large amount of vendor code in
dist
directories which we had not excluded via thetsconfig
. I'm mostly interested to see if the error reporting can be improved.I put together a standalone script which generates two "legit" files,
file1.ts
andfile2.ts
, and a huge filegarbage-0.js
(39MB). It then opens typescript-language-server and plays back the commands I recorded when I was experiencing this problem from my editor (Neovim).Saving
test.js
andtsconfig.json
to an empty directory and runningnode test.js
should be sufficient to see the error and stack trace in the output.Here is the script
test.js
.Here is the tsconfig.json:
The text was updated successfully, but these errors were encountered: