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?

Solution:Jump to solution
AH! Found the issue! I had to add
dotenvx run -f .env --
in front of the generate command. ๐คฆโโ๏ธ6 Replies
@Duki try using file://
Also i dont know if using the file protocol supports relative paths, but I guess we will find out lol
I'm still getting the same error. When I run
prisma generate
myself it runs through without any error. It only happens when using BA's generate. It has worked before tho ๐ค
Also doesnt work without a relative path "file://dev.db"
Solution
AH! Found the issue! I had to add
dotenvx run -f .env --
in front of the generate command. ๐คฆโโ๏ธbecause initially I had this in my
schema.prisma
file:
I changed it to a hardcoded value, because I thought it would be easier that way, but apparently BA doesn't use the same prisma client as the one generated via prisma generate
and somehow still had the version with the env("DATABASE_URL")
in it, instead of the hard coded one ๐ค
Which is weird, because the error that it logs are coming from the newly generated schema.prisma
file. I am very confused right now ๐
Which schema.prisma
does BA use during the generating process?wdym? We generate based on the auth config
nvm I mixed things up during the initialisation of the prisma client. All clear now! Conside this issue as resolve ๐ thanks a lot for your help!