fix(solid-query): expose deferred SSR query errors#11060
Conversation
Deferred server queries settle in the resource while the proxy-backed store remains on its optimistic result. Read settled properties from the resource during SSR so query.error and the related status are renderable without forcing an ErrorBoundary. Constraint: Preserve initial-error resolution used by SolidStart redirect flows. Rejected: Reject the server resource for initial errors | would force ErrorBoundary handling and regress redirect behavior from TanStack#9841. Confidence: high Scope-risk: narrow Directive: Keep server property reads aligned with the serialized resource result. Tested: Solid Query ESLint, TypeScript current, 322 library tests, package build, and manual Node SSR render. Not-tested: Automated SSR regression test because the current Vitest project resolves Solid's browser build. Related: TanStack#8300
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesSolid Query SSR state
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎯 Changes
status,isError, anderrorwithout requiring an ErrorBoundary.@tanstack/solid-query.The server subscriber resolves
queryResource, but it does not synchronize the proxy-backedstate. After a deferred query failed, server renders therefore kept reading the initial pending result. Reading the resolved resource on the server keeps rendered state aligned with the serialized resource.Closes #8300
✅ Checklist
pnpm run test:pr.pnpm test:prwas attempted. Affected builds and tests ran, but the command failed in unrelated package type matrices because the local Corepack cache returnedEACCESwhile spawningpnpm.cjs.Focused validation passed:
pnpm --filter @tanstack/solid-query test:eslintpnpm --filter @tanstack/solid-query test:types:tscurrentpnpm --filter @tanstack/solid-query test:lib --run(322 tests)pnpm --filter @tanstack/solid-query buildno data:error:true:SSR Error🚀 Release Impact
Summary by CodeRabbit