[GH-ISSUE #1963] Invalid prisma auth config using init cli #8985

Closed
opened 2026-04-13 04:13:48 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @pnodet on GitHub (Mar 23, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1963

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Run the init command

npx @better-auth/cli@latest init

Choose prisma from the database options

Current vs. Expected behavior

Generated auth file:

import { PrismaAdapter } from 'better-auth/adapters/prisma';
import { PrismaClient } from '@prisma/client';
import { betterAuth } from 'better-auth';

const client = new PrismaClient();

export const auth = betterAuth({
  database: new PrismaAdapter(client, {
    provider: 'pg',
  }),
});

Expected:

import { prismaAdapter } from 'better-auth/adapters/prisma';
import { PrismaClient } from '@prisma/client';
import { betterAuth } from 'better-auth';

const client = new PrismaClient();

export const auth = betterAuth({
  database: prismaAdapter(client, {
    provider: 'postgresql',
  }),
});

What version of Better Auth are you using?

1.2.4

Provide environment information

System:
    OS: macOS 15.3.1
    CPU: (14) arm64 Apple M4 Pro
    Memory: 278.34 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.13.0 - ~/.local/state/fnm_multishells/72839_1742488534092/bin/node
    npm: 10.9.2 - ~/.local/state/fnm_multishells/72839_1742488534092/bin/npm
    pnpm: 9.15.4 - ~/.local/state/fnm_multishells/72839_1742488534092/bin/pnpm
    bun: 1.2.5 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 134.0.6998.118
    Safari: 18.3
  npmPackages:
    better-auth: 1.2.4 => 1.2.4
Originally created by @pnodet on GitHub (Mar 23, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1963 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Run the init command ```zsh npx @better-auth/cli@latest init ``` Choose prisma from the database options ### Current vs. Expected behavior Generated auth file: ```ts import { PrismaAdapter } from 'better-auth/adapters/prisma'; import { PrismaClient } from '@prisma/client'; import { betterAuth } from 'better-auth'; const client = new PrismaClient(); export const auth = betterAuth({ database: new PrismaAdapter(client, { provider: 'pg', }), }); ``` Expected: ```ts import { prismaAdapter } from 'better-auth/adapters/prisma'; import { PrismaClient } from '@prisma/client'; import { betterAuth } from 'better-auth'; const client = new PrismaClient(); export const auth = betterAuth({ database: prismaAdapter(client, { provider: 'postgresql', }), }); ``` ### What version of Better Auth are you using? 1.2.4 ### Provide environment information ```bash System: OS: macOS 15.3.1 CPU: (14) arm64 Apple M4 Pro Memory: 278.34 MB / 24.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.13.0 - ~/.local/state/fnm_multishells/72839_1742488534092/bin/node npm: 10.9.2 - ~/.local/state/fnm_multishells/72839_1742488534092/bin/npm pnpm: 9.15.4 - ~/.local/state/fnm_multishells/72839_1742488534092/bin/pnpm bun: 1.2.5 - /opt/homebrew/bin/bun Browsers: Chrome: 134.0.6998.118 Safari: 18.3 npmPackages: better-auth: 1.2.4 => 1.2.4 ```
GiteaMirror added the lockedbug labels 2026-04-13 04:13:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8985