Hi I try to use vue-material on project which use typescript. When I try to register plugin 'vue-material'
import 'es6-promise/auto'
import * as Vue from 'vue'
import App from './App.vue'
import VueMaterial from 'vue-material'
Vue.use(VueMaterial)
// mount
new Vue({
name: 'RootVue',
el: '#app',
render: h => h(App, {
props: { propMessage: 'World' }
})
})
the errors in shown
error TS7016: Could not find a declaration file for module 'vue-material'. 'C:\git\testing\webpack_simple\node_
modules\vue-material\dist\vue-material.js' implicitly has an 'any' type.
My tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"es2015"
],
"module": "commonjs",
"moduleResolution": "node",
"isolatedModules": false,
"experimentalDecorators": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"removeComments": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
]
},
"include": [
"./src/**/*.ts"
],
"compileOnSave": false
}
it seems that problem was because of "noImplicitAny": true, switching to false resolved problem
@diskman Thanks a ton! You saved my day. :beers:
~Instead of setting noImplicitAny, I found that setting allowSyntheticDefaultImports to true allows vue-material to be imported correctly, i guess it's a case of vue-material bundle's export style? Microsoft/TypeScript#10895~
Seems i was mistaken? my build env fooled me
Thanks
it seems that problem was because of "noImplicitAny": true, switching to false resolved problem
thanks i was getting this error in production finally resolved...
Hello guys! I am getting same error, when I just simply create new Vue project via vue-cli and follow official installation guideline. I am not using typescript and did not check to support TS while creating Vue project.
Switching "noImplicitAny": true to false did not help me (although I am not sure I changed it in the right place, since there are several tsconfig.json in my node_modules, I used located in vue-template-compiler).
What am I doing wrong?
Most helpful comment
it seems that problem was because of "noImplicitAny": true, switching to false resolved problem