T
TanStack2mo ago
fair-rose

Data loader called twice

What might be causing the data loader to be called twice during SSR in the solidjs example? For instance on the /users route https://tanstack.com/start/latest/docs/framework/solid/examples/start-basic React example does not seem to have this behavior.
2 Replies
reduced-jade
reduced-jade2mo ago
thats really odd... must be a bug I think I found a fix
fair-rose
fair-roseOP2mo ago
Thanks for looking into this. Looking at the pull request and comparing to React code, I think there might be a different way of fixing this via useLayoutEffect util function, so it would prefer createEffect on server and createRenderEffect on client. Similar util function is used for React as well. AFAIK Solid's createEffect won't run on server, which should then fix it, but it isn't immediately obvious to the reader that the intent is to not run something on the server.

Did you find this page helpful?