[GH-ISSUE #1138] Cannot call cli generate successfuly #8611

Closed
opened 2026-04-13 03:44:07 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @h4kbas on GitHub (Jan 4, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1138

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Follow the current docs
  2. then call
    npx @better-auth/cli generate or with --config it won't matter

Current vs. Expected behavior

Normally it needs to successfuly generate a migration

What version of Better Auth are you using?

1.1.10

Provide environment information

- OSX Sonoma 14.6

Which area(s) are affected? (Select all that apply)

Documentation, Package

Auth config (if applicable)

import { db } from "@/db/drizzle";
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";

export const auth = betterAuth({
  database: drizzleAdapter(db, {
    provider: "pg", // or "mysql", "sqlite"
  }),
  //emailAndPassword: {
  //    enabled: true
  //},
  //socialProviders: {
  //   github: {
  //    clientId: process.env.GITHUB_CLIENT_ID,
  //    clientSecret: process.env.GITHUB_CLIENT_SECRET,
  //   }
  //},
});

Additional context

No response

Originally created by @h4kbas on GitHub (Jan 4, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1138 ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce 1. Follow the current docs 2. then call `npx @better-auth/cli generate` or with --config it won't matter ### Current vs. Expected behavior Normally it needs to successfuly generate a migration ### What version of Better Auth are you using? 1.1.10 ### Provide environment information ```bash - OSX Sonoma 14.6 ``` ### Which area(s) are affected? (Select all that apply) Documentation, Package ### Auth config (if applicable) ```typescript import { db } from "@/db/drizzle"; import { betterAuth } from "better-auth"; import { drizzleAdapter } from "better-auth/adapters/drizzle"; export const auth = betterAuth({ database: drizzleAdapter(db, { provider: "pg", // or "mysql", "sqlite" }), //emailAndPassword: { // enabled: true //}, //socialProviders: { // github: { // clientId: process.env.GITHUB_CLIENT_ID, // clientSecret: process.env.GITHUB_CLIENT_SECRET, // } //}, }); ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-13 03:44:07 -05:00
Author
Owner

@de-mawo commented on GitHub (Jan 9, 2025):

Any Solution as yet ? I am working with drizzle as well

<!-- gh-comment-id:2579419259 --> @de-mawo commented on GitHub (Jan 9, 2025): Any Solution as yet ? I am working with drizzle as well
Author
Owner

@henrikzabel commented on GitHub (Jan 13, 2025):

#1200 I made a fix. This works for me

<!-- gh-comment-id:2588365234 --> @henrikzabel commented on GitHub (Jan 13, 2025): #1200 I made a fix. This works for me
Author
Owner

@h4kbas commented on GitHub (Jan 16, 2025):

https://www.reddit.com/r/better_auth/comments/1htn92d/cannot_solve_this_generate_command_problem/

After this discussion on Reddit, I have found out kziemski's comment is directly related stitching it here.

It's an issue with something in the auth.ts bc if it can't run locally then it just spits out that error. I had to write an auth.local.ts that made a direct connection to a sqllite database for instance. Can you sanitize the auth.ts file and show it? 
<!-- gh-comment-id:2596691850 --> @h4kbas commented on GitHub (Jan 16, 2025): https://www.reddit.com/r/better_auth/comments/1htn92d/cannot_solve_this_generate_command_problem/ After this discussion on Reddit, I have found out kziemski's comment is directly related stitching it here. ``` It's an issue with something in the auth.ts bc if it can't run locally then it just spits out that error. I had to write an auth.local.ts that made a direct connection to a sqllite database for instance. Can you sanitize the auth.ts file and show it? ```
Author
Owner

@moshetanzer commented on GitHub (Mar 25, 2025):

Hey @h4kbas,

Did you manage to solve this issue?

<!-- gh-comment-id:2750523412 --> @moshetanzer commented on GitHub (Mar 25, 2025): Hey @h4kbas, Did you manage to solve this issue?
Author
Owner

@h4kbas commented on GitHub (Mar 25, 2025):

Hey @h4kbas,

Did you manage to solve this issue?

I actually solved it and it was related to something else failing making it spit this error just like people said on reddit but I don't remember what was the issue. Happy to share my exact configurations and stuff

<!-- gh-comment-id:2750528873 --> @h4kbas commented on GitHub (Mar 25, 2025): > Hey [@h4kbas](https://github.com/h4kbas), > > Did you manage to solve this issue? I actually solved it and it was related to something else failing making it spit this error just like people said on reddit but I don't remember what was the issue. Happy to share my exact configurations and stuff
Author
Owner

@moshetanzer commented on GitHub (Mar 25, 2025):

Hey,

Great! No need. Feel free to close issue ❤️

<!-- gh-comment-id:2750532486 --> @moshetanzer commented on GitHub (Mar 25, 2025): Hey, Great! No need. Feel free to close issue ❤️
Author
Owner

@mdex-geek commented on GitHub (Aug 29, 2025):

@de-mawo did you find any solution i also uing same stack and getting same issue

<!-- gh-comment-id:3236294735 --> @mdex-geek commented on GitHub (Aug 29, 2025): @de-mawo did you find any solution i also uing same stack and getting same issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8611