[GH-ISSUE #1189] Cli not generating Prisma schema #8636

Closed
opened 2026-04-13 03:46:55 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @henrikzabel on GitHub (Jan 11, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1189

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Follow the tutorial in the documentation

Current vs. Expected behavior

The schema is not generated. It never asks me where to put the schema. When running npx @better-auth/client generate it does something (displays a lot of different file names) and then exists.

What version of Better Auth are you using?

^1.1.11

Provide environment information

System:
  OS: Windows 10 10.0.19045
Binaries:
  Node: 21.5.0 - C:\Program Files\nodejs\node.EXE
  Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
  npm: 8.3.0 - ~\AppData\Roaming\npm\npm.CMD
  Watchman: 20231008.002904.0 - C:\ProgramData\chocolatey\bin\watchman.EXE

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

Other

Auth config (if applicable)

import { betterAuth } from "better-auth";
import { prismaAdapter } from "better-auth/adapters/prisma";
import prisma from "../prisma/instance.db";

export const auth = betterAuth({
  database: prismaAdapter(prisma, { provider: "postgresql" }),
  emailAndPassword: {
    enabled: true,
  },
});

---
// instance.db.ts
import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

export default prisma;

File-structure

backend
├── lib
│   ├── auth.ts
│   ├── log-in.tsx
│   └── choose-screen.tsx
├── prisma
│   ├── instance.db.ts
│   ├── middleware.ts
│   └── schema.prisma
├── services
│   └── encrypting.ts
├── src
│   └── index.ts
├── .env
├── bun.lockb
├── package-lock.json
├── package.json
└── tsconfig.json

Package.json

{
  "name": "backend",
  "version": "1.0.50",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "bun run --watch src/index.ts"
  },
  "dependencies": {
    "@elysiajs/swagger": "^1.2.0",
    "better-auth": "^1.1.11",
    "elysia": "latest",
    "uuid": "^11.0.5"
  },
  "devDependencies": {
    "@types/uuid": "^10.0.0",
    "bun-types": "latest",
    "prisma": "^6.2.1",
    "tsx": "^4.19.2"
  },
  "module": "src/index.js"
}

Additional context

No response

Originally created by @henrikzabel on GitHub (Jan 11, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1189 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Follow the tutorial in the documentation ### Current vs. Expected behavior The schema is not generated. It never asks me where to put the schema. When running `npx @better-auth/client generate` it does something (displays a lot of different file names) and then exists. ### What version of Better Auth are you using? ^1.1.11 ### Provide environment information ```bash System: OS: Windows 10 10.0.19045 Binaries: Node: 21.5.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.3.0 - ~\AppData\Roaming\npm\npm.CMD Watchman: 20231008.002904.0 - C:\ProgramData\chocolatey\bin\watchman.EXE ``` ### Which area(s) are affected? (Select all that apply) Other ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth"; import { prismaAdapter } from "better-auth/adapters/prisma"; import prisma from "../prisma/instance.db"; export const auth = betterAuth({ database: prismaAdapter(prisma, { provider: "postgresql" }), emailAndPassword: { enabled: true, }, }); --- // instance.db.ts import { PrismaClient } from "@prisma/client"; const prisma = new PrismaClient(); export default prisma; ``` #### File-structure ``` backend ├── lib │ ├── auth.ts │ ├── log-in.tsx │ └── choose-screen.tsx ├── prisma │ ├── instance.db.ts │ ├── middleware.ts │ └── schema.prisma ├── services │ └── encrypting.ts ├── src │ └── index.ts ├── .env ├── bun.lockb ├── package-lock.json ├── package.json └── tsconfig.json ``` #### Package.json ```json {   "name": "backend",   "version": "1.0.50",   "scripts": {     "test": "echo \"Error: no test specified\" && exit 1",     "dev": "bun run --watch src/index.ts"   },   "dependencies": {     "@elysiajs/swagger": "^1.2.0",     "better-auth": "^1.1.11",     "elysia": "latest",     "uuid": "^11.0.5"   },   "devDependencies": {     "@types/uuid": "^10.0.0",     "bun-types": "latest",     "prisma": "^6.2.1",     "tsx": "^4.19.2"   },   "module": "src/index.js" } ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-13 03:46:55 -05:00
Author
Owner

@Bekacru commented on GitHub (Jan 11, 2025):

please share what error is shown and more details about your setup. In general, it should work. Make sure to have auth.ts in one of the suggested places or pass --config for custom path.

<!-- gh-comment-id:2585378073 --> @Bekacru commented on GitHub (Jan 11, 2025): please share what error is shown and more details about your setup. In general, it should work. Make sure to have auth.ts in one of the suggested places or pass --config for custom path.
Author
Owner

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

@Bekacru I updated my issue. This also happens with Drizzle (#1188, #1138, also not working for me)

<!-- gh-comment-id:2585386698 --> @henrikzabel commented on GitHub (Jan 11, 2025): @Bekacru I updated my issue. This also happens with Drizzle (#1188, #1138, also not working for me)
Author
Owner

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

The console says something like:

[#########.........] / idealTree:faw7c31a11d552: timing idealTree:#root Completed in 3492ms

<!-- gh-comment-id:2585930829 --> @henrikzabel commented on GitHub (Jan 12, 2025): The console says something like: `[#########.........] / idealTree:faw7c31a11d552: timing idealTree:#root Completed in 3492ms`
Author
Owner

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

#1200 I fixed it and created a pull request

<!-- gh-comment-id:2585962687 --> @henrikzabel commented on GitHub (Jan 12, 2025): #1200 I fixed it and created a pull request
Author
Owner

@dosubot[bot] commented on GitHub (Jun 13, 2025):

Hi, @HenrikZabel. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You reported an issue with the CLI not generating a Prisma schema on Windows 10 using Better Auth version ^1.1.11.
  • Bekacru suggested checking the presence of auth.ts or using --config for a custom path.
  • You mentioned similar issues with Drizzle and later resolved the problem.
  • You submitted a pull request to address the issue, indicating a resolution has been found.

Next Steps:

  • Please confirm if the issue is still relevant to the latest version of the better-auth repository by commenting here.
  • If no further updates are provided, the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:2970840746 --> @dosubot[bot] commented on GitHub (Jun 13, 2025): Hi, @HenrikZabel. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You reported an issue with the CLI not generating a Prisma schema on Windows 10 using Better Auth version ^1.1.11. - Bekacru suggested checking the presence of `auth.ts` or using `--config` for a custom path. - You mentioned similar issues with Drizzle and later resolved the problem. - You submitted a pull request to address the issue, indicating a resolution has been found. **Next Steps:** - Please confirm if the issue is still relevant to the latest version of the better-auth repository by commenting here. - If no further updates are provided, the issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8636