Vue-material: Error TS7016: Could not find a declaration file for module 'vue-material'

Created on 17 Feb 2017  路  6Comments  路  Source: vuematerial/vue-material

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
}

Most helpful comment

it seems that problem was because of "noImplicitAny": true, switching to false resolved problem

All 6 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lee-frank picture lee-frank  路  3Comments

tridcatij picture tridcatij  路  3Comments

jtouzy picture jtouzy  路  3Comments

markus-s24 picture markus-s24  路  3Comments

Feduch picture Feduch  路  3Comments