Skip to content

vue2, webpack & typescript support: Could not find a declaration file for module 'vue-cryptoicon/src/icons' #13

@dcolley

Description

@dcolley
webpack compiled with 1 error
ERROR in src/main.ts:9:18
TS7016: Could not find a declaration file for module 'vue-cryptoicon/src/icons'. '/Users/derek/Sites/metaspan/demo/node_modules/vue-cryptoicon/src/icons/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/vue-cryptoicon` if it exists or add a new declaration (.d.ts) file containing `declare module 'vue-cryptoicon/src/icons';`
     7 | // import Cryptoicon from 'vue-cryptoicon'
     8 | const Cryptoicon = require('vue-cryptoicon')
  >  9 | import icon from 'vue-cryptoicon/src/icons'
       |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
    10 | Cryptoicon.add(icon)
    11 | Vue.use(Cryptoicon)
    12 |

I simply added this file in same directory as main.ts:
shims-cryptoicon.d.ts

declare module 'vue-cryptoicon'
declare module 'vue-cryptoicon/src/icons'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions