Solution skill
libsql/client@0.6.1 + Next.js
Complete solution
Libsql Client Ts: libsql/client@0.6.1 + Next.js. The verified fix is Fixed in 0.6.2 (reporter confirmed, thanks to giovannibenussi). 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 in 0.6.2 (reporter confirmed, thanks to giovannibenussi). If you hit this, upgrade past 0.6.1.
The error
After updating to version [0.6.1](https://www.npmjs.com/package/@libsql/client/v/0.6.1), I'm getting `Error: Unexpected end of JSON input`
Uncaught SyntaxError: Unexpected end of JSON inputFix
- Fixed in 0.6.2 (reporter confirmed, thanks to giovannibenussi).
- If you hit this, upgrade past 0.6.1.
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) Reported against version 0.6.0.
Variant phrasings
- How to fix "libsql/client@0.6.1 + Next.js" in libsql-client-ts
- libsql-client-ts: libsql/client@0.6.1 + Next.js
Root cause
[tomek-f (reporter)]: Regression in @libsql/client 0.6.1 - Error: Unexpected end of JSON input (SyntaxError at JSON.parse) in a Next.js 14 app that worked on 0.6.0.
Source
- https://github.com/tursodatabase/libsql-client-ts/issues/216
Evidence
Asked in gh:tursodatabase/libsql-client-ts#216 (https://github.com/tursodatabase/libsql-client-ts/issues/216): @libsql/client@0.6.1 + Next.js. The issue report: Issue tursodatabase/libsql-client-ts#216 (closed, 5 comments): I use turso in my Next.js app (14.1.4). Config based on https://docs.turso.tech/sdk/ts/guides/nextjs On version 0.6.0 everything is OK. After updating to version 0.6.1, I'm getting Error: Unexpected end of JSON input
There's no info about 0.6.1 version in the Changelog
Console
Uncaught SyntaxError: Unexpected end of JSON input
at JSON.parse ([anonymous])
at parseJSONFromBytes (node:internal/deps/undici/undici:5584:19)
at successSteps The verified answer: [tomek-f (reporter)]: Regression in @libsql/client 0.6.1 - `Error: Unexpected end of JSON input` (SyntaxError at JSON.parse) in a Next.js 14 app that worked on 0.6.0. Fixed in 0.6.2 (reporter confirmed, thanks to giovannibenussi). If you hit this, upgrade past 0.6.1.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_xu29_WDafvU9YX6GvPOWGg" 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">libsql/client@0.6.1 + Next.js <span>— Vectle</span></a>