-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(solid-router): loaders being called twice during SSR #4574
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
fix(solid-router): loaders being called twice during SSR #4574
Conversation
View your CI Pipeline Execution ↗ for commit b0dc899
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-with-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-plugin
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-plugin
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-server-functions-client
@tanstack/start-server-functions-fetcher
@tanstack/start-server-functions-server
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
Pointing out that the React version is using a router/packages/react-router/src/utils.ts Lines 13 to 14 in 7938ff4
This is then used throughout the Transitioner.
There is also a rough equivalent for this in Solid version, but it isn't used anywhere. router/packages/solid-router/src/utils.ts Lines 3 to 4 in 9e35918
Instead, all such occurrences are currently using
Currently the pull request only changes the behavior of the first |
Yeah i tried to touch as little as possible. I tried changing from a renderEffect to a createEffect but that broke some unit tests. Didn't look too much further after that |
Basically my understanding is that the
load
function gets called once during SSR but right now ourTransitioner
calls it again as it appearscreateRenderEffect
run on the server too where as theuseEffect
in React doesn't.The fix is just to bail out if its running on the server. Feels kinda hacky but it works.