sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
78.03k stars 4.08k forks source link

svelte 5 : structural clone failed #12438

Closed zhihengGet closed 1 month ago

zhihengGet commented 1 month ago

Describe the bug

clone.js:53  Uncaught (in promise) DOMException: Failed to execute 'structuredClone' on 'Window': () => {
  } could not be cloned.

here is my repo for lexical svelte 5 port

https://github.com/zhihengGet/lexical-svelte

if you update svelte to 5.0.0-next.184 then it breaks, works in 183 , im not using $state.snapshot anywhere in the code

Reproduction

https://github.com/zhihengGet/lexical-svelte, main branch, then update svelte to 184and run bun dev

Logs

No response

System Info

windows 11

Severity

blocking an upgrade

henrikvilhelmberglund commented 1 month ago

Editor.svelte line 57 $inspect('setting change', settings()); This breaks it, uncomment it for it to at least load (still a bunch of other things that cannot be cloned). Also please make a smaller repro.

zhihengGet commented 1 month ago

ahh ok , i thought only $state.snapshot uses it , but i guess $inspect is using clone too, this can be closed if this is the case!