Basic store example is not reactive
I'm struggling to understand why this code isn't reactive
I expect the
createEffect
to run twice, but it only runs once. What am I missing here?4 Replies
I suspect that you are still pulling in the server version of Solid which isn't reactive.
Compare to:
https://stackblitz.com/edit/vitejs-vite-ut3nkg?file=src%2Fmain.ts&terminal=dev
peerreynders
StackBlitz
Vitejs - Vite (forked) - StackBlitz
Next generation frontend tooling. It's fast!
That seems to be the case, but it's unclear to me why those imports are "still" resolving to the server versions of solid, despite being explicit
Okay, I see the problem: solid-js/store/dist/store.js imports solid-js which then resolves to the server version because of conditional exports.
package.json:
I also came up with the workaround to bundle beforehand, but I'm trying to use the bun runtime without bundling. I think this problem can only be truly fixed by a standalone reactivity package, which I know is in the works, so I'll close this post for now.