T
TanStack•2w ago
typical-coral

Streaming responses only sends first chunk

Hey all! I'm trying to integrate TanStack Start into Vercel Workflow DevKit using nitro and noticed an issue with streaming responses from server routes. I'm unsure if this is just me. When streaming a response (e.g. using ReadableStream), only the first chunk appears to be sent to the client. This seems to happen consistently across different stream tests. Some things I've checked: - Response headers seem to be correct (content type is application/octet-stream) - The same streaming code is correct since it works in other frameworks (including nitro itself) The specific return statement in the server route: https://github.com/vercel/workflow/blob/80b8a707ffcde73b5d4592d949185858a6b8f9e8/workbench/tanstack/src/routes/api/trigger.ts#L47 The specific test that fails (only the first chunk is logged): https://github.com/vercel/workflow/blob/80b8a707ffcde73b5d4592d949185858a6b8f9e8/packages/core/e2e/e2e.test.ts#L119
GitHub
workflow/workbench/tanstack/src/routes/api/trigger.ts at 80b8a707ff...
Workflow DevKit: Build durable, reliable, and observable apps and AI Agents in Typescript - vercel/workflow
GitHub
workflow/packages/core/e2e/e2e.test.ts at 80b8a707ffcde73b5d4592d94...
Workflow DevKit: Build durable, reliable, and observable apps and AI Agents in Typescript - vercel/workflow
8 Replies
fascinating-indigo
fascinating-indigo•2w ago
can you share a full project? does this happen in dev / prod?
typical-coral
typical-coralOP•2w ago
the project is here: https://github.com/vercel/workflow/tree/80b8a707ffcde73b5d4592d949185858a6b8f9e8/workbench/tanstack just dev for now and local prod, both fail consistently
fascinating-indigo
fascinating-indigo•2w ago
i cloned this repo, then ran
git checkout feat/tanstack-support
pnpm i
pnpm build
git checkout feat/tanstack-support
pnpm i
pnpm build
Tasks: 20 successful, 20 total now when i try to launch the dev server in the tanstack folder, i get
Error: Cannot resolve module "@workflow/swc-plugin" (from: /private/tmp/workflow/packages/nitro/dist/rollup.js)
typical-coral
typical-coralOP•2w ago
ah, seems like @workflow/swc-plugin was removed from nitro package should be fixed now :)
fascinating-indigo
fascinating-indigo•2w ago
yep next one
[POST] /api/trigger?workflowFile=workflows/0_calc.ts&workflowFn=calc&args=2
Error 400 Workflow file "workflows/0_calc.ts" not found
[POST] /api/trigger?workflowFile=workflows/0_calc.ts&workflowFn=calc&args=2
Error 400 Workflow file "workflows/0_calc.ts" not found
when i open the dev server, i see this in the browser
typical-coral
typical-coralOP•2w ago
i think our turbo cache might be cooked locally 😅 just fixed this as wel. do a pull, it should be the last of the errors spin up the tanstack server then in another terminal (in project root), run this to start the e2e tests against tanstack: APP_NAME=tanstack DEPLOYMENT_URL=http://localhost:3000 pnpm test:e2e any thoughts @Manuel Schiller?
fascinating-indigo
fascinating-indigo•2w ago
didnt have time yet to try again sorry
typical-coral
typical-coralOP•2w ago
ah no worries. im trying to get this ship ready by tuesday if possible 🙂

Did you find this page helpful?