Skip to content

Using await with @const inside shadcn sidebar causing every element to be doubled #17075

@henrykrinkle01

Description

@henrykrinkle01

Describe the bug

Before this, I used const foo = $derived(await getFoo()); in the script tag. However, this causes every dropdown elements to not function. In an attempt to fix the issue, I move it down to the markup section using @const and now everything is displayed twice. It seems one version is from SSR and non-interactive and the other is from hydration.

Reproduction

https://www.sveltelab.dev/3vx9kfe91ay59c8

Logs

System Info

svelte@5.43.0
kit@2.48.3

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions