-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
False positive errors at end-of-file #3942
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This happens to me in a monorepo containing some nuxt projects as well. |
using nuxt, now the autocomplete and suggestions does not work at all |
I dont know if this is related but i used to use volar + neovim (lspconfig) a lot in single files, just writing quick scripts in TS and that no longer works. I do see it works when tsconfig is in the root however. Not sure if there is a way to make this optional, im assuming its the same as original issue here |
The only solution that worked for me for now is downgrading to |
After investigation from microsoft/TypeScript#57630, this does appear to be an issue with the Svelte extension. Please make sure you have disabled the Svelte extension in Vue workspace. If you don't have Svelte extension installed and this problem still occurs, please open a new issue and provide a reproduction. |
Yeap. It seems the extension crashes with some others. Thanks @johnsoncodehk I also disabled not using extensions and errors gone. |
@namhong2001 Can you share which extension caused the conflict for you? |
I'm removed |
I have error message shows that the tsconfig is missing but it does exist. I found that disabling |
I don't know what the relationship is, but when the styled-componets extension was enabled, the Vue - Oficial plugin stopped working correctly from version 2.x onwards. Therefore, until the problem is fixed, there are two possible paths:
|
In my case only the option 1 has helped. I don't know what |
That feels like a different problem? The addon doesn't stop working (it spews out errors, but it otherwise fine, mostly), and certainly not after a few minutes (immediately for me, after initialising). |
Wouldn't it work if I increased the version of TypeScript I'm using? Vue - Official @2.0.6 Doesn't work well it works fine I would like you to check your current Typescript version. |
@johnsoncodehk You closed this issue, which is fine, but are we absolutely sure the problem wasn't in this addon? The problem only occurred with a combination of this addon, and the styled-components one. Just telling people not to install the latter one, is not a solution, even if the problem is in that addon. By closing this issue, it feels like you're sure the problem (and solution) is in the styled-components addon. So one more time then: is some type of collaboration with them being done to get to an actual proper solution? |
@thany I think this issue has been closed because the change that caused it has been reverted -> so it's now fixed. |
@thany "Closed via" means a PR or a commit had fixed this issue, and a new release is coming. Just upgrade to 2.0.7. |
That PR just reverts back to the same thing the old addon version did, so the issue only appears solved. When going into hybrid mode (presumably, from the looks of the PR) it will still break in the exact same way. This is why I keep asking to collaborate with the author of the addon that it is breaking on. Working together might actually solve the problem. |
You should only enable hybrid mode when you have a tsconfig and have ts 5.3+ installed.
Other ts plugins are not related. This is a vscode and typescript's fault-tolerance problem, not ours. |
This can easily be autodetected, can't it? |
I have this problem with Nuxt. there is a tsconfig. but for every newly created file, I get the same behaviour unless I restart vscode. |
#4206 implements the detection of installed extensions to determine whether to enable Hybrid Mode automatically. If you find a compatible extension ID that is not added to the whitelist, please leave a comment in the PR. |
@johnsoncodehk Why it is not able to find auto generated tsconfig Nuxt projects?! is there something wrong? |
I see the comments understand that the full TS server has been restored, so it would be best to be able to turn on Takeover mode to improve performance, but he still detects warnings every time I open the project, should I use some way to turn off the warnings or is there no need to disable the built-in server? |
There is no need to disable the built-in server. If hybrid mode is enabled, both typescript and vue files' language services are provided by the built-in server. If disabled, vue's language service is provided by an external language server. |
thank you |
On mac vs code open multiple windows at the same time may occasionally saving stuck out, forgive can not be determined to float, the situation is like this System: node@v18.19.0 vscode Volar@2.0.11 |
Disabling svelte.svelte-vscode seems to have solved it for me |
I don'thave any of the conflictive plugins and on the very latest version it's still failing with the same issues as described in the thread. Only downgrading fixed them. |
Disabling astro-build.astro-vscode solved the issue for me. |
For me it was the Marko VSCode Plugin which caused this issue |
I can 2nd @patriktoth67 suggestion. Seems either this extension conflicts with other or VS Code has some outstanding bug that causes this issue. Considering people suggest downgrading to a earlier version works as well, it might be with this extension. Or the newer versions of this extension uses some API code from VS Code that's causing the bug, and not the extension itself. |
TS plugin cannot be used with Vue files if the project does not contain tsconfig/jsconfig, or the Vue files are not included by tsconfig/jsconfig.
Steps to reproduce
Since it is just for demonstration purposes, node_modules will not be installed.
tsconfig.json
file in reposrc/components/HelloWorld.vue
HelloWorld.vue
, opensrc/main.ts
, then re-openHelloWorld.vue
Exploration
@vue/typescript-plugin
callsdecorateLanguageService
anddecorateLanguageServiceHost
at following code to modify the originallanguageService
andlanguageServiceHost
:language-tools/packages/typescript-plugin/index.ts
Lines 62 to 63 in 3efa52d
This works well for
ConfiguredProject
. But forInferredProject
, if you open the TS file before opening the Vue file, the modification ofdecorateLanguageService
is no longer valid, just like the originallanguageService
is no longer used. Therefore the mapping behavior ofdecorateLanguageService
is no longer valid.Temporary Solutions
jsconfig.json
file in project root with empty json object content{}
Update: If you have the "Svelte for VS Code" extension installed, disabling it may avoid this problem.
The text was updated successfully, but these errors were encountered: