I have a vue library that if I install it from its github repository works well, however, when I'm in my nuxt project and make an npm link to the library I get the following type error when I import the component from the library and use it inside the components object:
No overload matches this call.
The last overload gave the following error.
Type 'typeof MdButton' is not assignable to type 'Component<any, any, any, any> | AsyncComponent<any, any, any, any>'.
Property 'util' is missing in type 'typeof MdButton' but required in type 'VueConstructor<Vue>'
And that same error over and over again with each component that I import from the library
The library is made in JS and compiled with rollup and the nuxt project is in TS. To use the library in TS I created a d.ts file that exports the definitions of all the components like this:
export class MdButton extends Vue {}
export class MdButton extends Vue {
click: () => void
}
Which allows me to put inside the brackets the component methods that I want to use in the repository. I've tried several ways to fix the error (even setting the declarations like: export const MdButton: Component<any, any, any, any>) but none of them worked
This is how I declare the library files in the package.json
"main": "dist/material.ssr.js",
"browser": "dist/material.esm.js",
"module": "dist/material.esm.js",
"unpkg": "dist/material.min.js",
"types": "material.d.ts",
"files": [
"dist/*",
"src/**/*.vue",
"!src/serve-dev.*",
"material.d.ts",
"static/*"
],
Any help or clue of what the problem could be is highly appreciated