Skip to content

Cryptic type error in vue after install pinia #823

Discussion options

You must be logged in to vote

I didn't say anything

I think so because you moved it from issues.

Yeah, looks like my useRoute implementation wasn't correct.

In general, this errors happens in such cases:

import { ref } from '@vue/composition-api';
import { AsyncComponent, Component } from 'vue';

export type VueComponent = Component<any, any, any, any> | AsyncComponent<any, any, any, any> | (() => Component);

export interface Foo {
    component: VueComponent;
}

export function useFoo() {
    const foo: Foo = {
        component: {},
    };

    const fooRef = ref(foo);

    const secondFoo: Foo = {
        component: {},
    };
    
    fooRef.value = secondFoo; // Type 'Foo' is not assignable to type '{ componen…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@posva
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by posva
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #822 on November 23, 2021 12:43.