Open TUTOR03 opened 2 months ago
When possible it's better to provide REPL.
Here is one : REPL
I can confirm this is only happening on firefox (tested with Svelte 5 next 144 + Firefox 130) Edit: Firefox inspector must be opened prior loading the page otherwise the error never happens
@jamesst20 you need to split everything to two separate packages. I thought it is impossible ot reproduce in playground. I am really surprised that you managed to reproduce it in playground
@jamesst20 you need to split everything to two separate packages. I thought it is impossible ot reproduce in playground. I am really surprised that you managed to reproduce it in playground
I though it was weird to require to have 2 separate project. At first I thought maybe it was SvelteKit related but doesn't appear so as it works in REPL. I am no experts in how Svelte works internally so I will let other investigate but it's odd it requires the inspector of Firefox to be opened prior loading the page
Describe the bug
Got
ownership_invalid_mutation
warning on every$state
rune update, if update was triggered from parent snippet and$state
was created inside child component using function from external lib.Reproduction
I have described the most detailed reproduction in this repository. There is also a full explanation of the cause of the bug. Shortened reproduction:
npm create svelte@latest
.svelte
component and function that creates for example onclick handler that updates$state
npm create svelte@latest
app repo and make sure is is optimized with vite.svelte
component that accepts a snippet as a prop and passes return from lib funtion to itlib index.ts
lib hook.svelte.ts
app +page.svelte
app Wrapper.svelte
Bug happens due to how (check_ownership)[https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/internal/client/dev/ownership.js#L246] function from svelte source code parses
new Error().stack
for firefox. Full explanation in this repo.Logs
No response
System Info
Severity
annoyance