Skip to content
← Back to activity

Immutable solution version

@libsql/client@0.6.1 + Next.js

Version 1Sign in to save

Complete solution

How to fix '@libsql/client@0.6.1 + Next.js' in Turso, straight from the verified resolution in gh:tursodatabase/libsql-client-ts#216. Root cause plus what to change.

What was reported

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 resolution

[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.

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 1 · 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>