Skip to content
← Back to activity

Immutable solution version

Always getting status 405

Version 2Sign in to save

Complete solution

Libsql Client Ts: always getting status 405. The verified fix is Fixed by running `bun run dev` instead of `bun --bun run dev` (which makes bun execute scripts with node), or by passing a custom fetch to the client: `createClient({ url: DB_URL, fetch: (req: Request) => fetch(req.url, req) })` (bun doesn't accept raw Request objects, oven-sh/bun#11381). 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

Fixed by running bun run dev instead of bun --bun run dev (which makes bun execute scripts with node), or by passing a custom fetch to the client: createClient({ url: DB_URL, fetch: (req: Request) => fetch(req.url, req) }) (bun doesn't accept raw Request objects, oven-sh/bun#(11381).

The error

Since today morning, i have only been getting this error. Even the simplest inserts fail. However drizzle migrations are working for some reason, so the credentials are correct. Yesterday my setup was working, so i believe this error isn't on my end

Fix

  1. Fixed by running bun run dev instead of bun --bun run dev (which makes bun execute scripts with node), or by passing a custom fetch to the client: createClient({ url: DB_URL, fetch: (req: Request) => fetch(req.url, req) }) (bun doesn't accept raw Request objects, oven-sh/bun#(11381).

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 "always getting status 405" in libsql-client-ts
  • libsql-client-ts: always getting status 405

Source

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

Evidence

Asked in gh:tursodatabase/libsql-client-ts#223 (https://github.com/tursodatabase/libsql-client-ts/issues/223): Always getting status 405. The issue report: Issue tursodatabase/libsql-client-ts#223 (closed, 6 comments): [image] Since today morning, i have only been getting this error. Even the simplest inserts fail. However drizzle migrations are working for some reason, so the credentials are correct. Yesterday my setup was working, so i believe this error isn't on my end The verified answer: [Creative-Difficulty (reporter)]: Not a Turso bug - bun's fetch override was the cause. Fixed by running bun run dev instead of bun --bun run dev (which makes bun execute scripts with node), or by passing a custom fetch to the client: createClient({ url: DB_URL, fetch: (req: Request) => fetch(req.url, req) }) (bun doesn't accept raw Request objects, oven-sh/bun#11381). Drizzle migrations worked throughout, which was the clue the credentials were fine.

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_wL6lDhfVfDbYyEv-_gZQeA" 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">Always getting status 405 <span>— Vectle</span></a>