CLI doesn't detect Remix/React Router auth.server.ts config #679

Closed
opened 2026-03-13 08:00:01 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @conermurphy on GitHub (Feb 15, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Follow the setup guide for Remix
  2. Run the CLI genereate command: npx @better-auth/cli generate
  3. Command errors

Workaround:

  1. Rename lib/auth.server.ts to lib/auth.ts
  2. Rerun the CLI generate command
  3. Command succeeds

Current vs. Expected behavior

Currently, the migration script errors with the below error when using the auth.server.ts naming convention as recommended in the docs.

No configuration file found. Add a `auth.ts` file to your project or pass the path to the configuration file using the `--config` flag.

I'd expect the command to succeed when using the auth.server.ts naming convention in a Remix/RR project.

What version of Better Auth are you using?

1.1.18

Provide environment information

- OS: Mac OS 15.3

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

Package

Auth config (if applicable)

N/A

Additional context

Tested with a fresh install on the latest version of the package.

Originally created by @conermurphy on GitHub (Feb 15, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Follow the [setup guide for Remix](https://www.better-auth.com/docs/integrations/remix) 2. Run the CLI `genereate` command: `npx @better-auth/cli generate` 3. Command errors Workaround: 1. Rename `lib/auth.server.ts` to `lib/auth.ts` 2. Rerun the CLI `generate` command 3. Command succeeds ### Current vs. Expected behavior Currently, the migration script errors with the below error when using the `auth.server.ts` naming convention as recommended in the docs. ``` No configuration file found. Add a `auth.ts` file to your project or pass the path to the configuration file using the `--config` flag. ``` I'd expect the command to succeed when using the `auth.server.ts` naming convention in a Remix/RR project. ### What version of Better Auth are you using? 1.1.18 ### Provide environment information ```bash - OS: Mac OS 15.3 ``` ### Which area(s) are affected? (Select all that apply) Package ### Auth config (if applicable) N/A ### Additional context Tested with a fresh install on the latest version of the package.
GiteaMirror added the bug label 2026-03-13 08:00:01 -05:00
Author
Owner

@Rakhsan commented on GitHub (Feb 17, 2025):

As in the title says I think the problem is it should be auth.server.ts not auth.sever.ts

@Rakhsan commented on GitHub (Feb 17, 2025): As in the title says I think the problem is it should be **auth.server.ts** not **auth.sever.ts**
Author
Owner

@conermurphy commented on GitHub (Feb 17, 2025):

As in the title says I think the problem is it should be auth.server.ts not auth.sever.ts

Ah apologies this is a typo on my part, I did test it (and still got the issue) with auth.server.ts locally not auth.sever.ts 🤦

@conermurphy commented on GitHub (Feb 17, 2025): > As in the title says I think the problem is it should be **auth.server.ts** not **auth.sever.ts** Ah apologies this is a typo on my part, I did test it (and still got the issue) with `auth.server.ts` locally not `auth.sever.ts` 🤦
Author
Owner

@Rakhsan commented on GitHub (Feb 18, 2025):

there is a commit it seems you can't do anything until they merge it. btw issue is fixed just have to merge

@Rakhsan commented on GitHub (Feb 18, 2025): there is a commit it seems you can't do anything until they merge it. btw issue is fixed just have to merge
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#679