Skip to content

fix: make the TanStack Start output work with current TanStack Start - #3

Merged
davedbase merged 2 commits into
mainfrom
fix/tanstack-start-output
Nov 11, 2026
Merged

davedbase merged 2 commits into
mainfrom
fix/tanstack-start-output

Conversation

@lxsmnsyc

@lxsmnsyc lxsmnsyc commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Depends on #2

Fixes the TanStack Start output. Current TanStack Start rejects the url that the compiled component builds, so the image never renders.

Changes

  • Add createTanstackImageUrl(url, values) to @solidjs/ogp. It encodes { data: { values } } with seroval's toJSON, which is how TanStack Start's client sends a GET payload, and appends it as the payload search parameter.
  • The generated component builds its url with that helper instead of JSON.stringify and the extra &createServerFn&raw parameters.
  • The generated code imports createServerFn from @tanstack/solid-start, and calls it with { method: 'GET' } only. createServerFn has no response option.
  • An image request carries no x-tsr-serverFn header, so TanStack Start sends the returned Response as is. That part needs no change.

Proof

  • Fails on feat/oxc-compiler: TanStack Start's handler (@tanstack/start-server-core 1.169.26) reads the payload with fromJSON(JSON.parse(payload)). For the payload the old output sends: node -e "require('seroval').fromJSON(JSON.parse(JSON.stringify({ data: { values: ['hello'] }, context: {} })))" throws Seroval Error (step: 3).
  • Passes on this branch: pnpm --filter @solidjs/ogp exec vitest run tests/tanstack.test.ts builds urls with the helper and decodes them the same way, getting back { data: { values } }.

Changeset

  • minor (tanstack-start-image-url.md): the fix, plus the new createTanstackImageUrl export.

Checks

  • Local: lint pass, format pass, typecheck pass, build pass, tests pass (47).

Roadmap

  • none

Cost

  • New dependency: seroval@^1.7.0. @solidjs/web and TanStack Start already depend on seroval 1.x.

Risk

  • Checked against the TanStack Start sources (@tanstack/start-client-core 1.170.22, @tanstack/start-server-core 1.169.26), not in a running TanStack Start app.
  • TanStack Start for Solid 2.0 is a release candidate (@tanstack/solid-start 2.0.0-rc.10, peer solid-js >=2.0.0-rc.20).

🤖 Generated with Claude Code

lxsmnsyc and others added 2 commits November 11, 2026 22:13
TanStack Start decodes the payload search parameter of a GET server
function call with seroval's fromJSON, which rejects the plain JSON the
compiled component sent. The new createTanstackImageUrl helper encodes
the payload with seroval. The generated code also imports createServerFn
from @tanstack/solid-start and no longer passes the response option,
which createServerFn does not take.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lxsmnsyc
lxsmnsyc force-pushed the fix/tanstack-start-output branch from e34027e to 7348fa3 Compare November 11, 2026 14:14
Base automatically changed from feat/oxc-compiler to main November 11, 2026 14:21
@davedbase
davedbase marked this pull request as ready for review November 11, 2026 14:22
@davedbase
davedbase merged commit beba201 into main Nov 11, 2026
5 checks passed
@davedbase
davedbase deleted the fix/tanstack-start-output branch November 11, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants