Skip to content
Source
Sign inSign up
TanStack/router

SSR crash on Vercel: "object is not iterable" in handleServerRoutes after upgrading to react-start@1.168.60 (start-server-core@1.169.39) #8584

Openjose-cleland(GitHub profile, opens in a new tab) opened this issue 3 comments

Describe the bug

After upgrading to the latest patched release of @tanstack/react-start (1.168.60, pulling in @tanstack/start-server-core@1.169.39 and @tanstack/router-core@1.171.34), our app crashes on every SSR request to / when deployed to Vercel (Node.js runtime, nodejs24.x, nitro vercel preset), with:

TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
    at handleServerRoutes (file:///var/task/_ssr/server-<hash>.mjs:1528:49)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)

This reproduces consistently on real Vercel infrastructure (confirmed via Vercel's own runtime error/log aggregation across multiple separate deployments of the identical commit), but we have not been able to reproduce it by invoking the exact same built .vercel/output/functions/__server.func/index.mjs bundle directly in a plain Node 24 process (both GET / and HEAD / against a bare new Request(...) return 200 locally, full HTML). So whatever triggers it depends on something specific to the real request/runtime context Vercel provides (headers, the context object with a real waitUntil, etc.) that we haven't been able to pin down yet from the outside.

Suspected cause

We noticed @tanstack/start-server-core@1.169.39 was released together with #8573 ("fix(start): align server function transport behavior"), which tightened normalizeSsrResponse/isSsrResponse in packages/router-core/src/ssr/handlerCallback.ts to throw (Expected a Response from the SSR handler) instead of silently passing through non-Response values, and reshaped the server-function result contract (result.error/result.result) in server-functions-handler.ts and ServerFunctionSerializationAdapter.ts. We suspect something in our app's SSR path produces a value that no longer satisfies the new, stricter contract, and that whatever is swallowing/transforming that TypeError ends up presenting it as "object is not iterable" rather than the new explicit error message — but we haven't fully traced it through the minified bundle yet.

Your Example Website or App

Not shareable (private production app), sorry — happy to provide more detail/log excerpts on request.

Steps to Reproduce the Bug or Issue

  1. Deploy a TanStack Start app to Vercel using the vercel nitro preset (Node.js runtime) with @tanstack/react-start@1.168.60.
  2. Request / (or any SSR page) from the deployed production URL.
  3. Observe a 500 with the stack trace above.

We were unable to reduce this to a minimal public repro yet since it doesn't reproduce outside real Vercel infrastructure in our testing — will update if we manage to isolate it further or narrow down which of our server functions/middleware triggers it.

Expected behavior

SSR request to / should render normally, as it did on @tanstack/react-start@1.168.26 (pre-upgrade).

Screenshots or Videos

No response

Platform

  • OS: Vercel (Linux, nodejs24.x runtime), nitro preset vercel
  • Browser: N/A (server-side crash)

Additional context

Versions involved: @tanstack/react-start@1.168.60, @tanstack/react-start-server@1.167.46, @tanstack/start-server-core@1.169.39, @tanstack/router-core@1.171.34, @tanstack/start-client-core@1.170.34, @tanstack/history@1.162.4, @tanstack/react-router@1.170.41.

We upgraded specifically to pick up the fix for the recent critical XSS advisory in @tanstack/react-start (GHSA-qx66-fv34-fjm8 / CVE-2026-102989), so we can't simply stay on the older version. Since 1.168.60 is currently the only released version carrying that security fix, this regression is currently blocking us from deploying it — we've had to roll back to the pre-CVE-fix version in production in the meantime.

tanstack/router version

1.168.60 (react-start) / 1.171.34 (router-core) / 1.169.39 (start-server-core)

Platform

Vercel (Node.js 24.x runtime, nitro vercel preset)

  1. please make sure that the vercel build really uses all the bumped packages. maybe rebuild without vercel build cache.

  2. schiller-manuel(GitHub profile, opens in a new tab) added labelsinformation needed

  3. Thanks for the quick response, @schiller-manuel! I redeployed with VERCEL_FORCE_NO_BUILD_CACHE=1 set (completely fresh install + build, no cache reuse) and confirmed via the build logs that it installed packages from scratch. Unfortunately the exact same crash reproduces on the fresh deployment (same bundle hash server-BEB-V1Vy.mjs, same stack trace, same line):

    TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
        at handleServerRoutes (file:///var/task/_ssr/server-BEB-V1Vy.mjs:1528:49)

    New deployment id for reference: dpl_AL57qa3UScFCFUQwagTxaRD6bqrk (fresh, no-cache build of the same commit as the original report). So it doesn't look like a stale-cache/version-mismatch issue on our end — the bundle is consistent and the crash is deterministic given the same input. Still haven't been able to reproduce it by invoking the built function directly in a bare Node process locally (only happens on real Vercel infra), so still narrowing down what's different about the real request/runtime context. Will keep digging and update here if we find more.

  4. Quick follow-up with a few extra details in case they help narrow this down:

    • Failing request is a plain GET / (Vercel runtime logs show GET / 500 [error/serverless], no special headers on our side). The same built .vercel/output/functions/__server.func bundle returns 200 for GET / and HEAD / when I call default.fetch(new Request(...), {}) directly in Node 24, so I can't reproduce outside the real Vercel runtime.
    • The throw is inside handleServerRoutes (createStartHandler), i.e. before any of our route components render. Our app does define file routes with server: { handlers } (API/webhook routes under /api/public/*), but / itself has no server option, so I'd have expected the matchedRoutes / middleware loops there to be trivial for this request.
    • Versions resolved in the failing build: react-start 1.168.60, react-start-server 1.167.46, start-server-core 1.169.39, start-client-core 1.170.34, router-core 1.171.34, history 1.162.4, react-router 1.170.41. Nitro vercel preset, Vercel nodejs24.x.
    • Rolling back to the previous deployment (react-start 1.168.26) fixes it immediately, so the regression is tied to this release set.

    If it would help, I'm happy to run a diagnostic build (e.g. extra logging around the iteration in handleServerRoutes) on a protected preview deployment and report back what value isn't iterable. Just point me at where you'd want the logging.

Sign in to join this conversation.