Closed fortil closed 6 years ago
I am using only Vetur and the built-in typescript support of Visual Studio Code.
Here's an instruction on how to make code
use your project's local tsc
version.
TL;DR: With a .ts
(not .vue
) file open click on the TypeScript version number in the bottom status bar.
The error you are showing is caused by not having
"experimentalDecorators": true,
in your tsconfig.json
. It is complaining about the @Component
syntax of vue-class-component
.
I also get this Error. I just installed it from the TypeScript template and i made sure this setting is in my tsconfig.json. I also changed the version of TypeScript to 2.7.1 and updated all packages. Is there something I missed?
Does this happen to you after restarting, well, everything? An old config might be still loaded in the mysterious and elusive "TypeScript Language Server"
Yes, just restarted my PC... Is there a way that fixes that config you're talking about?
I'm at a loss.JPG
. It doesn't happen to me with either 2.7.1 or code
's 2.6.2, even while/after running the compilation.
Maybe you have some weird extension installed?
Disabled all extensions except Vetur 0.11.7. Also I'm using Ubuntu 17.10 if that matters.
There are some issues about this in several projects but the only thing it says mostly is that it got fixed by "magic". I have literally no idea.
Yup, magic isn't kind to you today.
I am on that as well. Bubuntu Gnoum 17.10
Do you have globally installed typescript or tslint?
My node -v
is v8.7.0
Yes, both are globally installed for me. Also I'm using Node 9.5.0 and yarn as package manager but I installed the globals with npm.
Because yarn globals are weird with nvm?
Probably. And yes i'm also using nvm :D
Ok... I've found the Issue. Vetur doesn't like being in a VSCode Workspace. When you open it as single project it works just fine. What also works is adding the tsconfig.json with that property to the Workspace folder as a workaround. Should probably create an issue on the VSCode plugin or the language server. I don't really know how that stuff works tho.
Oh. Don't tell anyone, but I've never used workspaces. But I guess it looks in the root folder? I thought it would look upwards from the file.
Ye... I commented on this issue here: https://github.com/vuejs/vetur/issues/567
Now they have some more infos and can maybe fix it so people don't need to spend 2 hours of their live setting up a template...
Hi
I am working with VSC, nuxtjs and typescript, but in the .vue files I can't to see very well the syntax, I installed Vuter, but always it show this error
also, some any another errors that in .ts files aren't shows
Thanks