tursodatabase / libsql-client-ts

TypeScript/JavaScript client API for libSQL
https://docs.turso.tech/sdk/ts/quickstart
MIT License
182 stars 30 forks source link

Unable to run >= 0.6.1 on Edge / v8 runtimes #228

Open rawkode opened 1 week ago

rawkode commented 1 week ago
Cannot read properties of null (reading 'split')
  TypeError: Cannot read properties of null (reading 'split')
    at globalThis.fetch (index.js:8457:59)
    at async getIsSchemaDatabase (index.js:3926:18)
    at async HttpClient2.getIsSchemaDatabase (index.js:4248:32)
TypeError

I've narrowed this down to a change between 0.6.0 and 0.6.1.

My code runs fine on 0.6.0, but fails on 0.6.1 and 0.6.2.

https://github.com/tursodatabase/libsql-client-ts/compare/v0.6.0...v0.6.1

I'm not using libsql-client directly, but instead through drizzle.

My code is simply:

const client = createClient({
    url: process.env.TURSO_URL as string,
    authToken: process.env.TURSO_TOKEN as string,
});

const db = drizzle(client, { schema });

const videos = await db.query.youtubeVideoTable.findMany();
haaawk commented 1 week ago

Please try 0.6.2 @rawkode. I believe @giovannibenussi has already fixed the problem 3 weeks ago. Could you please verify @giovannibenussi and close the issue if it's already fixed?

rawkode commented 1 week ago

I tried that version first, and then identified the break was introduced in 0.6.1

haaawk commented 1 week ago

Yes. The change was done in 6.1 -> @giovannibenussi could you please have a look on this?

giovannibenussi commented 1 week ago

I don't see any split call in our code. Anyways, today we released @libsql/client 0.7.0, could you please try that one @rawkode?

Also, could you tell me more about your stack please? Thanks in advance!