I am currently in the process of updating vue js to version 2.5.2 along with typescript 2.5.3.
Below is my index.ts file:
import Vue from 'vue'
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
This is my tsconfig.json configuration:
{
"compilerOptions": {
"outDir": "./wwwroot/build/",
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"lib": [
"dom",
"es5",
"es2015.promise"
],
"types": [
"vue-typescript-import-dts"
],
"experimentalDecorators": true
},
"include": [
"Features/**/*.ts"
],
"exclude": [
"node_modules",
"wwwroot"
]
}
However, I encountered the following error message:
ERROR in C:\dev\proj\src\Proj.Web\node_modules\vue-typescript-import-dts\index.d.ts (3,36): error TS2304: Cannot find name 'Vue'.
My setup was functioning properly with vue js 2.4.
I made a change by removing the "allowSyntheticDefaultImports": true, based on this article
Previously, we already recommend using ES-style imports (import Vue from ‘vue’) everywhere with “allowSyntheticDefaultImports”: true in tsconfig.json. The new typings will officially move to ES-style import/export syntax, so that config is no longer necessary, and users are required to use ES-style imports in all cases.
If anyone could point out what I might be overlooking, I would greatly appreciate it.