nksaraf / vinxi

The Full Stack JavaScript SDK
https://vinxi.vercel.app
MIT License
1.91k stars 77 forks source link

cloudflare-pages preset + streaming hangs #246

Open Brendonovich opened 6 months ago

Brendonovich commented 6 months ago

I've been using vinxi + cloudflare pages via solid start for a while, but only recently have tried to enable streaming. With ssr: true and mode: 'stream' set, I get this warning from wrangler when running locally and none of my UI is served to the browser, just the entrypoint html.

▲ [WARNING] Failed to get worker definitions TypeError: fetch failed

      at fetch
  (/Users/brendonovich/Library/pnpm/global/5/.pnpm/wrangler@3.32.0/node_modules/wrangler/wrangler-dist/cli.js:17033:19)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async getRegisteredWorkers
  (/Users/brendonovich/Library/pnpm/global/5/.pnpm/wrangler@3.32.0/node_modules/wrangler/wrangler-dist/cli.js:127224:22)
      at async getBoundRegisteredWorkers
  (/Users/brendonovich/Library/pnpm/global/5/.pnpm/wrangler@3.32.0/node_modules/wrangler/wrangler-dist/cli.js:127243:29)
  {
    cause: ConnectTimeoutError: Connect Timeout Error
        at onConnectTimeout
  (/Users/brendonovich/Library/pnpm/global/5/.pnpm/wrangler@3.32.0/node_modules/wrangler/wrangler-dist/cli.js:5865:29)
        at
  /Users/brendonovich/Library/pnpm/global/5/.pnpm/wrangler@3.32.0/node_modules/wrangler/wrangler-dist/cli.js:5821:51
        at Immediate._onImmediate
  (/Users/brendonovich/Library/pnpm/global/5/.pnpm/wrangler@3.32.0/node_modules/wrangler/wrangler-dist/cli.js:5853:13)
        at process.processImmediate (node:internal/timers:478:21) {
      code: 'UND_ERR_CONNECT_TIMEOUT'
    }
  }

You should be able to repdroduce it here.

  1. pnpm install
  2. pnpm build
  3. pnpx wrangler pages dev dist
  4. Go to http://localhost:8788 and notice that the full response is never sent, and the above warning should be logged after a short amount of time
ryansolid commented 6 months ago

I guess you wouldn't know when this showed up then. It may have never worked. I needed to change stuff to make cloudflare work in beta months ago for deployment but haven't touched it since. Then again I've never use wrangler locally to test stuff. It's complaining that fetch failed but the error is all internal to their stuff.

ryansolid commented 6 months ago

Yeah I think we might need more specific reproduction. I've deployed the latest hackers streaming and it seems ok: https://solid-hackernews.pages.dev/

We need to narrow this down more.

EDIT: Nvm I see there is a reproduction

Brendonovich commented 6 months ago

@nksaraf the 'awaiting repro' label can be removed, i provided one when creating the issue