-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: state_unsafe_mutation Updating state inside a derived is forbidden. If the value should not be reactive, declare it without $state
#12571
Comments
As you can see the getter you are accessing is actually updating Since it's the first time that setter is accessed you are getting this error because it's actually accessing state. So this could be a bug of the implementation in runed (that was my idea so blame me eventually lol). At the same time this feels like something it should be possible to solve. I'll think about this a bit. |
This looks like a bug in |
* Updated to svelte5 dep * added link resources * updated client hooks * Commented out legos * removed unused code * added temp tanstack svelte5 adaptor from pr * WIP rework data tables for svelte5 * Updated svelte * Temp impl for svelte persisted store https://twitter.com/puruvjdev/status/1787037268143689894/photo/1 joshnuss/svelte-persisted-store#251 * WIP Runes * More svelte 5 conversion * Updated package json * WIP Svelte 5 work * Upgraded typography components to runes and use new snippets and props * More runes work * More Svelte 5 work * Updated facet filters to runes * Upgraded to @exceptionless/fetchclient * Updated deps * Upgraded to latest fetch client * Updated shad * Upgrade to eslint 9 https://github.com/sveltejs/kit/pull/12268/files * fixed invalid ref * Converted slots * Updated deps * Added some snippets * WIP Dashboard * Updated tailwind * Fixed copy * Fixed slots * Updated deps * Updated data tables and summaries * More conversion * Updated deps * Converted all components to runes * Some dispatch changes * WIP: Dispatch Changes * Updated deps * more dispatch work * Fixed linting errors * Updated svelte * Updated shad * Updated typescript * Updated deps * Fixed fetch client * Fixed svelte errors. * added conditional icon check * Update deps * WIP: Use svelte-query-runes TanStack/query#6981 * WIP - Reworked snippets and some other fixes. * Updated deps * WIP - Svelte 5 work * Updated deps * Updated to latest tanstack table * WIP: Filter runes work. * Fixed more errors. * Updated deps * Use svelte query pkg * Updated svelte and vitest * Fixed svelte query issues, fixed linting issues, fixed eventing. * Fixed web socket events * Updated deps * Fixed some filtering issues * Fixed persisted store * Updated packages * Fixed filter reactivity * Updated deps * Updated deps * fixed svelte query issues * Use runed media query * Update deps * Use runed media query * Fixed svelte issue with state_unsafe_mutation sveltejs/svelte#12571 * Ensure all runes are serialized with toJSON sveltejs/svelte#9639 * Added document visibility store and fixed more upgrades * Updated deps * Updated queries * WIP: Demoting tabs * Updated deps * Updates to tab promotion * Fixed bind warnings * Updated deps * Use new svelte query apis * Updated deps * Fixed stack promotion * Fixed grid issues * Fixed fetch client issues with the login forms * Added custom auth serializer * Force package install due to svelte 5 peer deps * rebuilt lock file * Update Document Visibility helper to match new runed pattern
Describe the bug
After upgrading from 193 to latest I started to get the following error message when I use derived.
state_unsafe_mutation Updating state inside a derived is forbidden. If the value should not be reactive, declare it without
$state
This seems like a bug because looking at the component source there is no updating inside of a derived value or in my $derived: https://github.com/svecosystem/runed/blob/main/packages/runed/src/lib/utilities/MediaQuery/MediaQuery.svelte.ts#L60
Reproduction
https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACo2QQU_DMAyF_4qxJrWTygaIU7cOcQcJtCPhkDXuFqlNoiTdmKr8dxTaQatduMX2y3v212Ela3KYf3SoeEOY47MxmKE_m1i4I9WeMEOnW1vGztqVVhq_YYp52RhtPXTwSkLy95bsGQJUVjeQ2FaRSFYj2VYK2nE7zBfLoV70GUlUMgVQauU8SPfC7Z62pSVSvXMBik6jqDRJG6luT1L4Qw73dw-P5muezFdMrZd_S6r1JXdiWXTXCYuG-_JALsBygxk2WshKksDc25ZC9ktoMPwHJai52hcMvWO4iccBSOXJVrwkeLPaOOj69s9ovNFTDjuta-Jq1StCPCY-aorIJ2II-WBXwMzERzofvvU43UGfLhwKmAmy8kgivZm4XKGbZhQwZRaYmtp2ozJcA_wM37tto4xuAgAA
Logs
Severity
blocking all usage of svelte
The text was updated successfully, but these errors were encountered: