[Vuejs]-Can't import module / library in Vue

0👍

I think there are multiple issues in your file:

  • Could not find a declaration file [..] is a Typescript error, which is probably happening because the Vue CLI comes with TS out of the box. If you don’t use TS, change <script> to <script lang="js">. I recommend always doing this either way.
  • Import vue and change export default {} export default Vue.extend({}) to let the app know it’s a Vue component.
  • Uncaught TypeError: vue__WEBPACK_IMPORTED_MODULE_0__.default is not a constructor usually means a default import could not be found in the file you’re referencing. Since you’re not trying to import a module default, I can only hope that one of the previous two issues is the cause of this. It could very well be that this issue lies within the library itself.

P.S. I’m used to coding in Vue 2, so it’s possible that some of my suggestions don’t apply the exact same way in Vue 3.

Leave a comment