0

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:

  • libsql version: 0.7.0
  • prisma version: ^5.15.1 I've tried restarting my development server and confirming that the environment variables are correctly loaded using console.log(process.env.TURSO_DATABASE_URL);. What could be causing this issue and how can I resolve it?

0