Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte 5: cannot bind to a <svelte:component/> element #11984

Closed
Ennoriel opened this issue Jun 10, 2024 · 2 comments · Fixed by #11985
Closed

Svelte 5: cannot bind to a <svelte:component/> element #11984

Ennoriel opened this issue Jun 10, 2024 · 2 comments · Fixed by #11985
Assignees
Labels
Milestone

Comments

@Ennoriel
Copy link
Contributor

Describe the bug

It is not possible to bind a Svelte 4 props to a <svelte:component/> element:

<script>
  import Test from './Test.svelte'

  let div
</script>

<svelte:component this={Test} bind:div />

There is an error: "$$components is not defined".

This seems to be the cause of Ennoriel/svelte-awesome-color-picker#75
For reference: Svelte 5: List of libraries not working out of the box #10359

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACo2OuwrCQBBFf2WYJk1I-jUK_oOdsdDsBAeyD3YnQQn5d3eNKGJjeYdz554Zex4oojrOaM-GUOHeeyxR7j6HONEglHJ0Y-jypYldYC-71rbCxrsgcKAo0AdnoKjqHKq1ViQmUQMJaJ5a29Sfrm1WRnUuPbFkBeTKcTvn_gIXtlqlEtQJTvPGae6ZNCoJIy3l2zbj_-kC0O2p-_LZfAn9bpyWB8l2UJMdAQAA

Logs

No response

System Info

REPL: running Svelte compiler version 5.0.0-next.152

Severity

blocking all usage of svelte

@dummdidumm dummdidumm added this to the 5.0 milestone Jun 10, 2024
@dummdidumm dummdidumm added the bug label Jun 10, 2024
@MotionlessTrain
Copy link
Contributor

I saw the error as well when I migrated Test to runes

The issue seems to be bind:div in the <svelte:component />. Changing that to {div} gets rid of the error

@Ennoriel
Copy link
Contributor Author

Thanks, that was quick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants