bestguy / sveltestrap

Bootstrap 4 & 5 components for Svelte
https://sveltestrap.js.org
MIT License
1.3k stars 180 forks source link

Error: Argument of type 'typeof ModalHeader' is not assignable to parameter of type 'ConstructorOfATypedSvelteComponent' #510

Closed JandosKh closed 1 year ago

JandosKh commented 1 year ago

I'm using VS Code 1.72 with extension for Svelte v106.2.0. With Sveltekit rc1 and typescript, I have a lot of errors like below: Argument of type 'typeof ModalHeader' is not assignable to parameter of type 'ConstructorOfATypedSvelteComponent'. Sample code:

<Modal isOpen={showDialog} toggle={toggleDialog} class="mt-5">
    <ModalHeader toggle={toggleDialog}>{t('Company deletion')}</ModalHeader>
    <ModalBody class="font-sm">
        {t('The company will be deleted. Continue?')}
    </ModalBody>
    <ModalFooter>
        <Button class="btn-sm" color="primary" on:click={async () => await deleteCompany()}>{t('Yes')}</Button>
        <Button class="btn-sm" color="secondary" on:click={toggleDialog}>{t('No')}</Button>
    </ModalFooter>
</Modal>

This happened when I upgraded from sveltestrap v5.7.0 to v5.9.0. The code actually runs without an issue, but VS Code shows the above errors. What am I missing?

bxgrant commented 1 year ago

I am seeing the same

bezaleel22 commented 1 year ago

I'm also seeing the same after upgrading, is this a bug?

bxgrant commented 1 year ago

Any word on this? It makes it super hard to code with errors everywhere.

bxgrant commented 1 year ago

Any word on this? I'm all in on this thing but man I need help on this. Anyone out there? Ideas? Is there a workaround? Do I need to downgrade a version to something older so it will work until it can be addressed?

bxgrant commented 1 year ago

Upgraded to the latest versions of everything and seemed to go away.

JandosKh commented 1 year ago

Looks like, the new version solved this issue. Closing.