Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dcolley opened this issue Jul 29, 2022 · 0 comments

Comments

@dcolley
Copy link

dcolley commented Jul 29, 2022

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant