better-auth cli failing with ECONREFUSED
Hello i am having an issue initially setting up better auth for a trial. The cli generate command is failing with spurious looking errors.
node: 22.17.1
nextjs: ^15.0.3
cli: latest
DB: postgresql
OS: MacOs 15.5
The auth is working successfully with memory adapter.
The database connection seems to connect successfully to the db instance when running the app normally (i receive a cannot find db does not exsist error which is expected as i have not created the db yet).
However when i run the cli generate command i get a couple of odd errors, weather i specify config location or not.
I have tried adding the env vars to my env as the error seems to indicate they are not being set due to the starting warning of "Social provider microsoft is missing clientId or clientSecret" and that it is trying to connect to a DB on localhost and not the one specified.
Logs and auth.ts in reply as too long for discord.
Solution:Jump to solution
Yeah it looks like it might be an ENV issue. Usually it's able to import
.env
files automatically tho, could it be that you have a different file name or using a different framework? š¤3 Replies
Solution
Yeah it looks like it might be an ENV issue. Usually it's able to import
.env
files automatically tho, could it be that you have a different file name or using a different framework? š¤Hello, Thanks that instantly solves this for me! i am using ".env.local" as my env file name. Thank you for your support. The Package is working great so far except this niggle. keep up the great work!