Skip to content

Svelte 5: error with a slot prop directly referenced #9797

@mquandalle

Description

@mquandalle

Describe the bug

I have 2 components:

  • a <BikeItem bike="" /> that accept a bike prop
  • a <FancyList items=[]> that accept an items prop and a slot slot="item"

The following code works with Svelte 4 but not with Svelte 5:

<script>
	import FancyList from "./FancyList.svelte"
	import BikeItem from "./BikeItem.svelte"

	const bikes = ['brompton', 'canyon']
</script>

<FancyList items={bikes}>
	<BikeItem slot="item" let:item={bike} {bike} />
</FancyList>

Svelte 4 REPL

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE51QQWrDMBD8itgefDHx3bUN7aEQ6A-iHBxlTUVtSUibUiP090pyY4cGSulJq93ZmdnxMMgRHdQHD6qfEGp4MgZKoNmkj_vAkTD-nb5YkTqNE1Ya6rjiJCejLbGXXon5VTpig9UT47Cr1tZuYeBwg3-W77gnnDb4tXOLjnihVSQ9xaFjLTsUp4g3pFVRskL0ao7Vkaum2iypZjMjI6FrfV4P2W-zKrtRU8shQTiwEalO5QIO7PupukS-EnYxhkmf5SDxDDXZC4ZyTW1F_TU7_MxZROnF6OOPQ_wD9uJtmbHe5SLkI5J3lmS3A3yeZsO-SnvhN6_XFP5hNQVz5zSndS94DF8HX7LpXgIAAA==

Logs

No response

System Info

Svelte 5

Severity

annoyance

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