v-perfect-signature icon indicating copy to clipboard operation
v-perfect-signature copied to clipboard

Vue2 errors with vue-demi

Open mheers opened this issue 2 years ago • 8 comments

When adding the library in Vue2 I get the following errors:

ERROR in ./frontend/node_modules/v-perfect-signature/dist/index.d.ts(7,34):
7:34 '"./frontend/node_modules/vue-demi/lib/index"' has no exported member named 'DefineComponent'. Did you mean 'defineComponent'?
     5 | 
     6 | declare type InputPoints = number[];
  >  7 | declare const _default: vue_demi.DefineComponent<{
       |                                  ^
     8 |     width: {
     9 |         type: StringConstructor;
    10 |         required: false;
ERROR in ./frontend/node_modules/v-perfect-signature/dist/index.d.ts(54,13):
54:13 Namespace '"./frontend/node_modules/vue-demi/lib/index"' has no exported member 'ComponentOptionsMixin'.
    52 |     resizeCanvas(clearCanvas?: boolean): void;
    53 |     inputPointsHandler(): void;
  > 54 | }, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, ("onBegin" | "onEnd")[], "onBegin" | "onEnd", vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<{
       |             ^
    55 |     width?: unknown;
    56 |     height?: unknown;
    57 |     backgroundColor?: unknown;
ERROR in ./frontend/node_modules/v-perfect-signature/dist/index.d.ts(54,45):
54:45 Namespace '"./frontend/node_modules/vue-demi/lib/index"' has no exported member 'ComponentOptionsMixin'.
    52 |     resizeCanvas(clearCanvas?: boolean): void;
    53 |     inputPointsHandler(): void;
  > 54 | }, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, ("onBegin" | "onEnd")[], "onBegin" | "onEnd", vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<{
       |                                             ^
    55 |     width?: unknown;
    56 |     height?: unknown;
    57 |     backgroundColor?: unknown;
ERROR in ./frontend/node_modules/v-perfect-signature/dist/index.d.ts(54,123):
54:123 Namespace '"./frontend/node_modules/vue-demi/lib/index"' has no exported member 'VNodeProps'.
    52 |     resizeCanvas(clearCanvas?: boolean): void;
    53 |     inputPointsHandler(): void;
  > 54 | }, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, ("onBegin" | "onEnd")[], "onBegin" | "onEnd", vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<{
       |                                                                                                                           ^
    55 |     width?: unknown;
    56 |     height?: unknown;
    57 |     backgroundColor?: unknown;
ERROR in ./frontend/node_modules/v-perfect-signature/dist/index.d.ts(54,145):
54:145 Namespace '"./frontend/node_modules/vue-demi/lib/index"' has no exported member 'AllowedComponentProps'.
    52 |     resizeCanvas(clearCanvas?: boolean): void;
    53 |     inputPointsHandler(): void;
  > 54 | }, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, ("onBegin" | "onEnd")[], "onBegin" | "onEnd", vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<{
       |                                                                                                                                                 ^
    55 |     width?: unknown;
    56 |     height?: unknown;
    57 |     backgroundColor?: unknown;
ERROR in ./frontend/node_modules/v-perfect-signature/dist/index.d.ts(54,178):
54:178 Namespace '"./frontend/node_modules/vue-demi/lib/index"' has no exported member 'ComponentCustomProps'.
    52 |     resizeCanvas(clearCanvas?: boolean): void;
    53 |     inputPointsHandler(): void;
  > 54 | }, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, ("onBegin" | "onEnd")[], "onBegin" | "onEnd", vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<{
       |                                                                                                                                                                                  ^
    55 |     width?: unknown;
    56 |     height?: unknown;
    57 |     backgroundColor?: unknown;

v-perfect-signature: 1.0.0 vue: 2.6.14

When I set "skipLibCheck": true in tsconfig.ts everything works fine.

mheers avatar Oct 20 '21 06:10 mheers

Will check in a bit. You have composition api installed right?

wobsoriano avatar Oct 20 '21 08:10 wobsoriano

Yes, I use @vue/composition-api with 1.2.4. And I use typescript with 4.4.4.

I successfully run @vueuse/core which also depends on vue-demi without errors.

mheers avatar Oct 20 '21 10:10 mheers

Can you create a simple repro that I can clone? Thanks

wobsoriano avatar Oct 20 '21 18:10 wobsoriano

Sure, have a look at https://github.com/mheers/v-signature-error

mheers avatar Oct 24 '21 08:10 mheers

Can you update to the latest version (1.1.2) and try again?

wobsoriano avatar Mar 04 '22 06:03 wobsoriano

I updated my demo repo at https://github.com/mheers/v-signature-error and still have no luck. It still reports the same errors.

mheers avatar Mar 04 '22 06:03 mheers

It works fine if the vue2 project is not typescript based, so the error must be lying here.

mheers avatar Mar 15 '22 13:03 mheers

https://github.com/vueuse/vue-demi/issues/152

wobsoriano avatar Apr 08 '22 18:04 wobsoriano