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: faulty ownership_invalid_binding errors are back, inside #if blocks #11483

Closed
markjaquith opened this issue May 6, 2024 · 0 comments · Fixed by #11490
Closed

Svelte 5: faulty ownership_invalid_binding errors are back, inside #if blocks #11483

markjaquith opened this issue May 6, 2024 · 0 comments · Fixed by #11490
Assignees
Milestone

Comments

@markjaquith
Copy link

Describe the bug

#11399 tracked faulty ownership_invalid_binding errors.

This was fixed for 5.0.0.next.121 in #11401.

Something in 5.0.0.next.123 broke it again, specifically inside #if blocks. (Probably 6e5ab2e ?)

The only thing I changed from @Rich-Harris's reproduction from #11399 was wrapping a dummy #if around the children:

<Outer>
  {#if true}
    <Inner bind:object />
  {/if}
</Outer>

"%c[svelte] ownership_invalid_binding\n%cOuter.svelte passed a value to Inner.svelte with bind:, but the value is owned by App.svelte. Consider creating a binding between App.svelte and Outer.svelte"

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE41RQU6EQBD8Sqc1WYgE9IqAetyTDxAPy9DoKPSQoTExhL-bmdHd1ZjNHuZQk6ruquoFO93ThPnTgrwbCHN8GEdMUD5HB6YP6oUwwcnMVrmfYlJWj1LVXIseRmMFHmchC501A2zSzKM0CDe3R7Qt8xHNo18093oSMM0bKYESLifZCUULKDOz5HANa3xbc5EdLHDh13k3y4XuQOxMq58mRVjYaG7z75lZIGa6W92coMUEB9PqTlOLudcn-zI844w6oN_xS1mjTDVWP0EWUK-6by0xrC7OaM04RfGfBMu9JW7J7sl3aRSvp0z5XOfeKBg5dOrq2DU9RfFJU0GQ-uZdV80sYhjcyrLGgGoEw6rX6r1cohjKCo5VVyXcrNWWlaWBWIosiP6p-3n9Av_binmHAgAA

Logs

No response

System Info

System:
    OS: macOS 14.4
    CPU: (10) arm64 Apple M1 Max
    Memory: 6.04 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.5.0 - ~/Library/Application Support/Herd/config/nvm/versions/node/v18.20.2/bin/npm
    pnpm: 7.21.0 - /opt/homebrew/bin/pnpm
    bun: 1.1.7 - /usr/local/bin/bun
  npmPackages:
    svelte: 5.0.0-next.123 => 5.0.0-next.123

Severity

annoyance

@dummdidumm dummdidumm added this to the 5.0 milestone May 6, 2024
@dummdidumm dummdidumm self-assigned this May 6, 2024
dummdidumm added a commit that referenced this issue May 6, 2024
fixes #11483
We need to keep track of the component function similar to how we keep track of the component context, so that effects etc have the correct one associated
Rich-Harris pushed a commit that referenced this issue May 6, 2024
fixes #11483
We need to keep track of the component function similar to how we keep track of the component context, so that effects etc have the correct one associated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants