-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
Description
Describe the bug
I'm creating a global store with $state and i'm exporting it with getter. When i'm using that store in #each, i getting Undefined is not an object (evaluating '$.get(roomStore).participants') error in my console. That error is not happening if I add $effect(() => void roomStore.participants); on script section.
Reproduction
You can check that here:
- download this repo https://github.com/markdomkan/join
- install dependencies (i'm using bun, but can be done with node)
- run it with dev script.
- enter on http://localhost:5173
- click on "create new room"
you should get the error in your console.
The implicated files are:
- src/lib/store/room.svelte.ts
- src/lib/components/Participants.svelte
If you uncomment the line 6 of Participants.svelte, the error should disappear
Logs
[Error] TypeError: undefined is not an object (evaluating '$.get(roomStore).participants')
in Participants.svelte
in +page.svelte
in +layout.svelte
in root.svelte
handle_error (chunk-HZ3R22HV.js:1609)
update_effect (chunk-HZ3R22HV.js:1771)
process_effects (chunk-HZ3R22HV.js:1891)
flush_queued_root_effects (chunk-HZ3R22HV.js:1822)
process_deferred (chunk-HZ3R22HV.js:1853)System Info
System:
OS: macOS 15.0.1
CPU: (8) arm64 Apple M1 Pro
Memory: 3.59 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
npm: 10.9.0 - /opt/homebrew/bin/npm
bun: 1.1.33 - /private/tmp/bun-node-247456b67/bun
Browsers:
Chrome: 129.0.6668.100
Safari: 18.0.1Severity
annoyance