Better AuthBA
Better Authโ€ข6mo ago
Duki

npx @better-auth/cli generate logs weird stuff on the console when run and fails

I just upgrade to 1.3.3 and for good measure I wanted to execute the cli comman generate and noticed that is logging some code in the terminal (added a screenshot, because it's too much text) and throws a prisma error at me.

The error makes no sense to me. It says the URL must start with "file:", but the url actually does start with file: and the error logs are even showing the line where file: is set ๐Ÿคจ Has anyone else encountered this issue?
PrismaClientInitializationError: error: Error validating datasource `db`: the URL must start with the protocol `file:`.
  -->  schema.prisma:14
   | 
13 |   provider = "sqlite"
14 |   url      = "file:./data.db"
   | 

Validation Error Count: 1
    at r (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma-app/client/runtime/library.js:115:2770) {
  clientVersion: '6.12.0',
  errorCode: 'P1012',
  retryable: undefined
}
image.png
Solution
AH! Found the issue! I had to add dotenvx run -f .env -- in front of the generate command. ๐Ÿคฆโ€โ™‚๏ธ
Was this page helpful?