Skip to content

Error with external Svelte 5 components #655

@legowhales

Description

@legowhales

Describe the bug

Using svelte-preprocess with Svelte 5 and importing a Svelte 5 component from an npm package triggers an error:
'p' has already been declared

Detailed error with a random package

Same error occurs with bits-ui@next, svelte-clerk...

✘ [ERROR] node_modules/ui-ingredients/dist/select/item-text.svelte:9:24 `p` has already been declared [plugin vite-plugin-svelte:optimize-svelte]

    node_modules/ui-ingredients/dist/select/item-text.svelte:9:24:
      9 │        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.l...
        ╵                         ^

  The plugin "vite-plugin-svelte:optimize-svelte" was triggered by this import

To Reproduce

I made a simple example here:

https://stackblitz.com/edit/sveltejs-kit-template-default-u71xqf?file=svelte.config.js

Is there a simple way to make it work?
Thank's for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions