sarthak kuwar
sarthak kuwar

Reputation: 11

Issue with libsql client in Next.js with correct environment variables

I'm currently facing an issue with integrating the libsql client into my Next.js application. Here's a simplified snippet of how I'm attempting to create the libsql client:

console.log(process.env.TURSO_DATABASE_URL);
const libsql = createClient({
  url: process.env.TURSO_DATABASE_URL!,
  authToken: process.env.TURSO_AUTH_TOKEN!
});

I've verified that my environment variables (TURSO_DATABASE_URL and TURSO_AUTH_TOKEN) are correctly set

However, when I run my Next.js application, I encounter the following error:

LibsqlError: URL_INVALID: The URL 'undefined' is not in a valid format

Additional Context:

Upvotes: 1

Views: 205

Answers (0)

Related Questions