Skip to content

break in sveltekit 2.0 #91

@applemate

Description

@applemate

uppon update to svelte kit 2.0, this not working any more.

code

toast.push({
				component: {
					src: SuccesToast,
					props: {
						header: 'Successfully Saved!',
						detail: 'Database is backup'
					}
				}
			})

succesToast.svelte

<script lang="ts">
	export let header: any
	export let detail: any = 'Successfully Saved!'
</script>

<div class="mb-2 font-semibold">
	<i class="fa-light fa-circle-check fa-xl mr-2 text-green-400"></i>
	<span class="capitalize">{header}</span>
</div>
<div class="mb-0.5 text-green-300">
	<i
		class="fa-light fa-circle-check fa-xl invisible mr-2 text-green-400"
	></i>
	<span>{detail}</span>
</div>

Error

No overload matches this call.
  Overload 1 of 2, '(msg: string, options?: SvelteToastOptions): number', gave the following error.
    Argument of type '{ component: { src: typeof SuccesToast; props: { header: string; detail: string; }; }; }' is not assignable to parameter of type 'string'.
  Overload 2 of 2, '(options: SvelteToastOptions): number', gave the following error.
    Type 'typeof SuccesToast__SvelteComponent_' is not 

Activity

zerodevx

zerodevx commented on Dec 21, 2023

@zerodevx
Owner

Prob due to a typescript config. Do things work if you //ts-ignore the call?

applemate

applemate commented on Dec 21, 2023

@applemate
Author

I use this toast all over the place, can't do the //ts-ignore everywhere

zerodevx

zerodevx commented on Dec 21, 2023

@zerodevx
Owner

No, I mean does the app work if you ignore it. I just want to be sure it's a typing error or a break, like what your title alludes to.

applemate

applemate commented on Dec 21, 2023

@applemate
Author

well I think it will work with //ts-ignore. just the vs code error is annoying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @applemate@zerodevx

        Issue actions

          break in sveltekit 2.0 · Issue #91 · zerodevx/svelte-toast