You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm getting an error when deriving from a value caused by the fact that at the point the derived rune is used, the original variable has a fixed value:
Reproduction
<scriptlang="ts">
let one:Array<number> |null=$state(null);let two =$derived(one===null?42:one.find((x) =>x>22) );
</script>
I get Error: Property 'find' does not exist on type 'never'.
Describe the bug
Hi,
I'm getting an error when deriving from a value caused by the fact that at the point the derived rune is used, the original variable has a fixed value:
Reproduction
I get
Error: Property 'find' does not exist on type 'never'.
Expected behaviour
No error
System Info
Which package is the issue about?
svelte-check
Additional Information, eg. Screenshots
https://svelte.dev/playground/feba78a349b34e49aedc626604866047?version=5.1.12
Looking at the JS output, the error makes sense.
In my actual usecase, I'm binding the variable
one
.The text was updated successfully, but these errors were encountered: