I've created a Vue project through Vue-CLI v3.0.0-beta.15, now, everything is working, I mean, when I do npm run serve
it compiles and runs fine but TypeScript throws the following error message and only inside the editor!
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
The things I've tried and didn't work:
I double check that the experimentalDecorators
is set to true in my tsconfig.json
file which Vue does by default.
I tried to create a jsconfig.json
file with the following options:
{
"compilerOptions": {
"experimentalDecorators": true
}
}
I tried to change the following options in VSCode "javascript.implicitProjectConfig.experimentalDecorators": true
Now, I'm using the Vetur extension with VSCode which I already posted an issue on their repo but I don't use any extensions with Visual Studio for Vue and yet I get the same error so I don't know what triggers it but I think that something doesn't pick the tsconfig.json
file.
Here are the steps I've taken to generate the project:
@vue/cli
I've used the following options:
Then navigate to dashboard/src/views/Home.vue
That's how it looks like in Visual Studio:
And that's how it looks like in VSCode:
As it turns out I had to create jsconfig.json
at the root of the folder where the tsconfig.json
file is and the error in Visual Studio goes away but VSCode still displays the error regardless to the options I've set but this seems like it's a Vetur bug as opposed to a bug in VSCode, TypeScript or a configuration issue.
Opening the Dashboard
folder as opposed to the Src
folder which is the actual root of my project "fixed" the problem in VSCode so I guess that Vetur doesn't pick the tsconfig.json
file when it's nested.