mirror of https://github.com/sveltejs/svelte
fix: ensure `$state.snapshot` never errors (#12445)
* fix: ensure `$state.snapshot` never errors Snapshotting can error on un-cloneable objects. It's not practical to error in this case; often there's no way out of this for users, so it makes sense to return the original value in that case, and warn in dev mode about it. closes #12438 * lint * single warning per snapshot call, list affected properties * lint * lint --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/12463/head
parent
07b0db83c5
commit
9c507a0a57
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure `$state.snapshot` never errors
|
@ -1,3 +1,11 @@
|
||||
## dynamic_void_element_content
|
||||
|
||||
> `<svelte:element this="%tag%">` is a void element — it cannot have content
|
||||
|
||||
## state_snapshot_uncloneable
|
||||
|
||||
> Value cannot be cloned with `$state.snapshot` — the original value was returned
|
||||
|
||||
> The following properties cannot be cloned with `$state.snapshot` — the return value contains the originals:
|
||||
>
|
||||
> %properties%
|
||||
|
Loading…
Reference in new issue