Skip to content

Svelte 5: scope is borked with slots and static props #9823

Closed
@Rich-Harris

Description

@Rich-Harris

Describe the bug

We set the child scope on the component node, for convenience, but that breaks when you combine slot props with static props of the same name:

<script>
	import Child from './Child.svelte';
	
	let thing = 'hello';
</script>

<Child thing={thing} let:thing>
	<p>thing: {thing}</p>
</Child>

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE42PQQrCMBBFrzIEoQrS7GNaEI9hXUib2kDaDMlUkNK7m6RVF7pwEZKfmf_nzcRabZRn4jyx4dorJtgRke0ZPTAKf1eGVNDejq6OP9LXTiOV1VCR7tE6glOnTQOtsz1kOU8qX4zZIbbFYxQBdXq4QQFZp4yxsSb5J22QS07qKqZ0zRB8Ij3TQIllEgLWuuRYxphkLQNnbxvdatUwQW5U8_69Vur4d7FIO628cyDeoLPot7svZG8svViA_wC4zE-YD5-CYwEAAA==

Logs

No response

System Info

next

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