Skip to content

TanStack Start on Cloudflare Pages is broken ("ReadableStream did not return bytes")  #3295

@newsve

Description

@newsve

Which project does this relate to?

Start

Describe the bug

Pretty much the title, once deployed I get on browser requests following errors.

I used the original code snippets from https://tanstack.com/start/latest/docs/framework/react/build-from-scratch (replaced index.tsx) and https://tanstack.com/start/latest/docs/framework/react/hosting#cloudflare-pages

✘ [ERROR] workerd/server/server.c++:3898: error: Uncaught exception: workerd/jsg/_virtual_includes/jsg/workerd/jsg/value.h:1372: failed: remote.jsg.TypeError: This ReadableStream did not return bytes.

  stack:
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2a656b3
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2b6627b
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2a656b3
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2b61c94
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2b686e7
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2b6627b
  ...

✘ [ERROR] Uncaught (in response) TypeError: This ReadableStream did not return bytes.


[wrangler:inf] GET /favicon.ico 200 OK (15ms)
✘ [ERROR] workerd/server/server.c++:3898: error: Uncaught exception: workerd/api/util.c++:60: failed: remote.jsg.TypeError: Gzip compressed stream ended prematurely.

  stack:
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2b6627b
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2a656b3
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2b61c94
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2b686e7
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2b6627b
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2a656b3
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2b61c94
  /home/a/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-arm64/bin/workerd@2a5b614
  ...

...and so on

Your Example Website or App

https://github.com/newsve/tts-cf-broken

Steps to Reproduce the Bug or Issue

  1. git clone https://github.com/newsve/tts-cf-broken.git
  2. npm run build
  3. npx wrangler pages dev dist/ --ip 0.0.0.0 (runs the production build locally and gets the same error as the og CF cloud env)
  4. Open your browser and head to the respective hostname + /hello

Expected behavior

No error and the browser should show "Hello..." which the prod build doesn't.

Screenshots or Videos

No response

Platform

  • OS: server Ubuntu, browser: Windows
  • Browser: Chrome
  • Version: 132.0.something

Additional context

FWIW, checked for issues before and found some CF issues but none like above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    startEverything about TanStack Start

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions