Skip to content
← Back to activity

Solution skill

Query hangs forever on Cloudflare Worker local dev

Version 2Sign in to save

Complete solution

Libsql Client Ts: query hangs forever on Cloudflare Worker local dev. The verified fix is Fix: [honzasp (maintainer)]: Fixed in @libsql/hrana-client 0.3.8 (a dependency of @libsql/client) - run `npm update`. Use this when you hit the symptoms above in libsql-client-ts; not for unrelated libsql-client-ts errors or general setup questions.

TL;DR

Fix: [honzasp (maintainer)]: Fixed in @libsql/hrana-client 0.3.8 (a dependency of @libsql/client) - run npm update. Reporter confirmed the repro works after the update.

The error

Debugging shows its stuck on this line but can't debug further because it just hangs, doesn't throw an error https://github.com/libsql/libsql-client-ts/blob/358767835750c69df3073d0f43bb7f9e2d8cc34f/src/hrana.ts#L64

Fix

  1. [honzasp (maintainer)]: Fixed in @libsql/hrana-client 0.3.8 (a dependency of @libsql/client) - run npm update.
  2. Reporter confirmed the repro works after the update.

Success check: the symptom above is gone and the original operation completes.

When to use

  • You hit this exact symptom in libsql-client-ts.
  • You want the verified fix without digging through the thread.

When not to use

  • A different error in libsql-client-ts, even a similar-looking one.
  • General libsql-client-ts setup or credential questions.

Compatibility

  • Libsql Client Ts (tursodatabase/libsql-client-ts)

Variant phrasings

  • How to fix "query hangs forever on Cloudflare Worker local dev" in libsql-client-ts
  • libsql-client-ts: query hangs forever on Cloudflare Worker local dev

Root cause

Root cause was in the hrana WebSocket client used by @libsql/client/web, which hung instead of connecting on Cloudflare Workers local dev (wrangler).

Source

  • https://github.com/tursodatabase/libsql-client-ts/issues/29

Evidence

Asked in gh:tursodatabase/libsql-client-ts#29 (https://github.com/tursodatabase/libsql-client-ts/issues/29): Query hangs forever on Cloudflare Worker local dev. The issue report: Issue tursodatabase/libsql-client-ts#29 (closed, 20 comments): Discord thread: https://discord.com/channels/933071162680958986/1100593117075345449/1100593117075345449

Running this code on Cloudflare Workers local dev hangs forever

import { createClient } from "@libsql/client/web";

await createClient({
  url: context.TURSO_DATABASE_URL,
  authToken value context.TURSO_AUTH_TOKEN,
}).execute(`select * from users`);

Debugging shows its stuck on this line but can't debug further because it just hangs, doesn't throw an error https://github.com/libsql/libsql-client-ts/blob/358767835750c69df3073d0f43bb7f9e2d8cc34f/src/hrana.ts#L64 The verified answer: [honzasp (maintainer)]: Fixed in @libsql/hrana-client 0.3.8 (a dependency of @libsql/client) - run npm update. Root cause was in the hrana WebSocket client used by @libsql/client/web, which hung instead of connecting on Cloudflare Workers local dev (wrangler). Reporter confirmed the repro works after the update.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_2dIVQ9xVz8NDa_LCc-YjYA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Query hangs forever on Cloudflare Worker local dev <span>— Vectle</span></a>