You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ts.TypeScriptNoContentAvailableException on compile #190
Starting from an empty project, I can compile TS code without problem.
As soon as I add types (under node_modules/@types) using npm, I get the following error message when saving a TS file:
Errors occurred during the build.
Errors running builder 'TypeScript Builder' on project 'TypescriptProject'.
Error while compiling with tsserver
java.util.concurrent.ExecutionException: ts.TypeScriptNoContentAvailableException: No content available.
Error while compiling with tsserver
java.util.concurrent.ExecutionException: ts.TypeScriptNoContentAvailableException: No content available.
For info: I have node.js v6.11.0 installed on my Windows computer. The error always occurs on my computer and occasionally occurs on my colleague's machine TypeScriptNoContentAvailableException.zip
How about the following code change in the IDETypeScriptProject class (two lines added): @OverRide
public void compileWithTsserver(List updatedTsFiles, List removedTsFiles, IProgressMonitor monitor)
throws TypeScriptException {
try {
List tsFilesToCompile = new ArrayList<>();
// Collect ts files to compile by using tsserver to retrieve
// dependencies files.
// It works only if tsconfig.json declares "compileOnSave: true".
if (collectTsFilesToCompile(updatedTsFiles, getClient(), tsFilesToCompile, false, monitor)) {
return;
}
// Compile ts files with tsserver.
if (compileTsFiles(tsFilesToCompile, getClient(), monitor)) {
return;
}
if (removedTsFiles.size() > 0) {
// ts files was removed, how to get referenced files which must
// be recompiled (with errors)?
}
But can we just ignore the exception really? Cause maybe there is really no content that is sent to the tsserver. The compilation then still fails (with or without error message).
I hope the problem is reproducible with the demo project I have attached to the issue.
I really would like to use the Typescript IDE plugin because it seems quite cool.
Same problem for me. Even with axelnerlich's small project: Sometimes I get a TypeScriptNoContentAvailableException when saving. Looks a bit terrifying...
It seems to be a timing problem, because the exception appears more frequently, when saving is done directly after editing.
Apart from this error, I'm really impressed by all the new features! Great work, anglozerr!
Same here, would be nice when fixed as the popup only appears at some arbitrary moments after a save, but is very annoying. As mentioned, the error from the tsserver could be valid and the question is why this error is returned?
I must study more cases whrn tsserver throws this error. If i remember it throws this error when you try tout savez a TS file which is excluded by tsconfih.JSON . it seems that there are more cases.
@angelozerr:
Do you think that this bug can be resolved soon? Can you reproduce the behaviour?
I have thoroughly tested your plugin for almost a week now. Everything looks very, very good, but this bug is really annoying.
I will show your plugin tomorrow in a presentation to my collegues. We would like to decide on the usage of your plugin, but this bug could be a showstopper. If I could at least tell them, that there is a good chance that this bug will be fixed...
I m on Holliday this week. I will try to fix it next week by ignoring this error everytime or on dôme cases if i understand cases when tsserver throws this error.
An observation: It seems to be a timing problem, because the exception appears more frequently, when saving is done directly after editing. If I wait some seconds after editing, the error is less frequent.
Ok I have decided to ignore the TypeScriptNoContentAvailableException exception with 8fa29dc
@axelnerlich I have used your project from TypeScriptNoContentAvailableException.zip and problem comes from tsserver. The first time when I save new_file.ts, the tsserver compileOnSaveEmitFile is executed to know while files must be compiled
So after node_modules/@types/jquery/index.d.ts are compiled and the TypeScriptNoContentAvailableException is thrown (it's normal because we cannot compile this file).
So we have not the exception. Is it a bug with TypeScript? The popup is not usable, so I have decided to ignore the error. If some guy find a better solution (like mark with warn file which cannot be compiled), any suggestion are welcome!
@angelozerr
Thanks for your quick reaction. The bugfix works for us. :-)
Just for curiosity: Does your plugin initiate the compilation for the files received in the compileOnSaveAffectedFileList response? If yes, why can't you filter away the 'index.d.ts' files when initiatiating the compilation?
Just for curiosity: Does your plugin initiate the compilation for the files received in the compileOnSaveAffectedFileList response? If yes, why can't you filter away the 'index.d.ts' files when initiatiating the compilation?
Good catch! I have implemented your idea with 566e841
Activity
angelozerr commentedon Jul 12, 2017
It's the TypeScript tsserver which throw this error. I think this error should be silent and not display an error when tsserver throws it.
axelnerlich commentedon Jul 12, 2017
How about the following code change in the IDETypeScriptProject class (two lines added):
@OverRide
public void compileWithTsserver(List updatedTsFiles, List removedTsFiles, IProgressMonitor monitor)
throws TypeScriptException {
try {
List tsFilesToCompile = new ArrayList<>();
// Collect ts files to compile by using tsserver to retrieve
// dependencies files.
// It works only if tsconfig.json declares "compileOnSave: true".
if (collectTsFilesToCompile(updatedTsFiles, getClient(), tsFilesToCompile, false, monitor)) {
return;
}
axelnerlich commentedon Jul 12, 2017
But can we just ignore the exception really? Cause maybe there is really no content that is sent to the tsserver. The compilation then still fails (with or without error message).
I hope the problem is reproducible with the demo project I have attached to the issue.
I really would like to use the Typescript IDE plugin because it seems quite cool.
stenzengel commentedon Jul 13, 2017
Same problem for me. Even with axelnerlich's small project: Sometimes I get a TypeScriptNoContentAvailableException when saving. Looks a bit terrifying...
It seems to be a timing problem, because the exception appears more frequently, when saving is done directly after editing.
Apart from this error, I'm really impressed by all the new features! Great work, anglozerr!
danielvanmil commentedon Jul 14, 2017
Same here, would be nice when fixed as the popup only appears at some arbitrary moments after a save, but is very annoying. As mentioned, the error from the tsserver could be valid and the question is why this error is returned?
Keep up the good work!
angelozerr commentedon Jul 16, 2017
I must study more cases whrn tsserver throws this error. If i remember it throws this error when you try tout savez a TS file which is excluded by tsconfih.JSON . it seems that there are more cases.
stenzengel commentedon Jul 18, 2017
@angelozerr:
Do you think that this bug can be resolved soon? Can you reproduce the behaviour?
I have thoroughly tested your plugin for almost a week now. Everything looks very, very good, but this bug is really annoying.
I will show your plugin tomorrow in a presentation to my collegues. We would like to decide on the usage of your plugin, but this bug could be a showstopper. If I could at least tell them, that there is a good chance that this bug will be fixed...
angelozerr commentedon Jul 18, 2017
I m on Holliday this week. I will try to fix it next week by ignoring this error everytime or on dôme cases if i understand cases when tsserver throws this error.
stenzengel commentedon Jul 18, 2017
@angelozerr:
Thank you!
An observation: It seems to be a timing problem, because the exception appears more frequently, when saving is done directly after editing. If I wait some seconds after editing, the error is less frequent.
Ignore TypeScriptNoContentAvailableException See
angelozerr commentedon Jul 25, 2017
Ok I have decided to ignore the TypeScriptNoContentAvailableException exception with 8fa29dc
@axelnerlich I have used your project from TypeScriptNoContentAvailableException.zip and problem comes from tsserver. The first time when I save new_file.ts, the tsserver compileOnSaveEmitFile is executed to know while files must be compiled
An it returns *.d.ts files:
So after node_modules/@types/jquery/index.d.ts are compiled and the TypeScriptNoContentAvailableException is thrown (it's normal because we cannot compile this file).
The second time, when I save new_file.ts, I have
So we have not the exception. Is it a bug with TypeScript? The popup is not usable, so I have decided to ignore the error. If some guy find a better solution (like mark with warn file which cannot be compiled), any suggestion are welcome!
angelozerr commentedon Jul 25, 2017
Once job https://opensagres.ci.cloudbees.com/job/typescript.java/423/ will be finished, you will able to install 1.4.0-SNAPSHOT https://github.com/angelozerr/typescript.java/wiki/Installation-Update-Site
angelozerr commentedon Jul 27, 2017
Guys, I close this issue, if you have again problem, please reopen the issue or create new one. Thanks!
stenzengel commentedon Jul 27, 2017
@angelozerr
Thanks for your quick reaction. The bugfix works for us. :-)
Just for curiosity: Does your plugin initiate the compilation for the files received in the compileOnSaveAffectedFileList response? If yes, why can't you filter away the 'index.d.ts' files when initiatiating the compilation?
Check if files is not a *.d.ts when compilation is done. See
angelozerr commentedon Jul 27, 2017
Good catch! I have implemented your idea with 566e841