Closed aborba-simeon closed 11 months ago
// types.d.ts
declare module '@vue-js-cron/light';
This should make the default import of @vue-js-cron/light
typed as any
(https://stackoverflow.com/a/50516783/3140799)
Make sure types.d.ts
is included: https://www.typescriptlang.org/tsconfig#include
Thanks for the fast reply. When adding the above to types.d.ts
I get:
Invalid module name in augmentation. Module '@vue-js-cron/light' resolves to an untyped module at '.../node_modules/@vue-js-cron/light/dist/light.umd.js', which cannot be augmented.ts(2665)
Sorry, but I'm not familiar with this error. The only thing I found, is that you should only declare one module per file. https://stackoverflow.com/a/42522751/3140799
e.g. create a new file types-light.d.ts
// types-light.d.ts
declare module '@vue-js-cron/light';
Do you have more stuff in types.d.ts
?
@abichinger that was it, I had two more declarations indeed. Sorry I missed that.
..."augmentation" means "declaring a module in the same file with other module declaration(s)
Thank you very much for your help!
Hey there. I have a Quasar v1.20.1 with TypeScript and I'm trying to install the vue-js-cron/light package (for Vue2, but I also tried others and Vue3), and in all attempts, I'm getting the error when importing:
I'm importing the package as:
Here it is my
package.json
:Vue version:
2.6.14
Typescript version:4.2.2
I also tried creating the declaration as;
And had no success.
Any help here is appreciated.