Skip to content

Conversation

@shrekuu
Copy link

@shrekuu shrekuu commented Dec 6, 2025

Reason:
I am trying out the guide: How to use Prisma ORM with Better Auth and Next.js

When I run npx @better-auth/cli generate it gives me an error:

2025-12-06T07:30:02.092Z ERROR [Better Auth]: [#better-auth]: Couldn't read your auth config. Error: Cannot find module '/Users/myusername/repos/betterauth-nextjs-prisma/generated/prisma/client'
Require stack:
- /Users/myusername/repos/betterauth-nextjs-prisma/src/lib/prisma.ts
    at Module._resolveFilename (node:internal/modules/cjs/loader:1410:15)
    at require.resolve (node:internal/modules/helpers:163:19)
    at jitiResolve (/Users/myusername/.npm/_npx/167ca1f116d365e6/node_modules/jiti/dist/jiti.cjs:1:148703)
    at jitiRequire (/Users/myusername/.npm/_npx/167ca1f116d365e6/node_modules/jiti/dist/jiti.cjs:1:150290)
    at import (/Users/myusername/.npm/_npx/167ca1f116d365e6/node_modules/jiti/dist/jiti.cjs:1:158307)
    at /Users/myusername/repos/betterauth-nextjs-prisma/src/lib/prisma.ts:1:217
    at eval_evalModule (/Users/myusername/.npm/_npx/167ca1f116d365e6/node_modules/jiti/dist/jiti.cjs:1:155533)
    at jitiRequire (/Users/myusername/.npm/_npx/167ca1f116d365e6/node_modules/jiti/dist/jiti.cjs:1:150967)
    at import (/Users/myusername/.npm/_npx/167ca1f116d365e6/node_modules/jiti/dist/jiti.cjs:1:158307)
    at /Users/myusername/repos/betterauth-nextjs-prisma/src/lib/auth.ts:3:45 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/myusername/repos/betterauth-nextjs-prisma/src/lib/prisma.ts' ]

I see the the path in /src/lib/prisma.ts is not correct, so I appended the "src" section.

The final import is like this:

import { PrismaClient } from "@/src/generated/prisma/client";

So I changed the path so that other people won't trip over it again. Cheers! :)

Summary by CodeRabbit

  • Documentation
    • Corrected import path references in the BetterAuth Next.js guide to align with the current project structure; no functional or behavioral changes.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

Walkthrough

A single documentation file had two import path corrections: the PrismaClient import path changed from @/generated/prisma/client to @/src/generated/prisma/client, and an auth import path changed from @/lib/auth to @/src/lib/auth.

Changes

Cohort / File(s) Summary
Import path corrections
content/800-guides/230-betterauth-nextjs.mdx
Updated two import paths inside the guide: PrismaClient import from @/generated/prisma/client@/src/generated/prisma/client, and auth import from @/lib/auth@/src/lib/auth.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Small, local text/code-sample edits only; no behavioral changes.
  • Check code samples render correctly and imported paths match repository layout.

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary change: updating import paths for the Prisma client to match the project structure by including the 'src' segment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9aea369 and 9fff1e1.

📒 Files selected for processing (1)
  • content/800-guides/230-betterauth-nextjs.mdx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • content/800-guides/230-betterauth-nextjs.mdx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant