After creating a Vue project through Vue-CLI v3.0.0-beta.15, the project runs smoothly when using npm run serve
. However, TypeScript displays an error message stating that support for decorators is experimental and subject to change in a future release, but strangely, this error only appears 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.
Attempts to fix the issue:
Ensured that
experimentalDecorators
is set to true in mytsconfig.json
file, as Vue does by default.Created a
jsconfig.json
file with the following options:{ "compilerOptions": { "experimentalDecorators": true } }
Attempted to change settings in VSCode using
"javascript.implicitProjectConfig.experimentalDecorators": true
Using the Vetur extension with VSCode led to posting an issue on their repository, yet the same error persists even without extensions in Visual Studio, indicating a possible issue recognizing the tsconfig.json
file.
The steps taken to generate the project were:
- mkdir experiment && cd $_
- npm init
- npm install -D
@vue/cli
- ./node_modules/.bin/vue create dashboard
Selected the following options:
- Required features: Babel, TS, PWA, Router, Vuex, CSS Pre-processors, Linter, Unit, E2E
- Use class-style component syntax? Yes
- Auto-detected polyfills with Babel and TypeScript? Yes
- CSS pre-processor choice: SCSS/SASS
- Linter config choice: TSLint
- Additional lint features: Lint on save
- Unit testing solution: Mocha
- E2E testing solution: Cypress
- Configuration preference for Babel, PostCSS, ESLint, etc.: Dedicated config files
- Save as a preset for future projects? No
Navigated to dashboard/src/views/Home.vue
Appearances of the project in Visual Studio:
https://i.stack.imgur.com/SYH3B.png
Differences are noted in the appearance in VSCode: