ERROR [Better Auth]: [#better-auth]: Couldn't read your auth config. Error: Cannot find module 'sqlite' Require stack: #904

Closed
opened 2026-03-13 08:09:17 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @huseeiin on GitHub (Mar 23, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

import { betterAuth } from "better-auth";
import { DatabaseSync } from "node:sqlite";

export const auth = betterAuth({
  database: new DatabaseSync("./sqlite.db"),
  emailAndPassword: { enabled: true },
});

Current vs. Expected behavior

node:sqlite is only available through the node: protocol

What version of Better Auth are you using?

1.2.4

Provide environment information

linux

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

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth";
import { DatabaseSync } from "node:sqlite";

export const auth = betterAuth({
  database: new DatabaseSync("./sqlite.db"),
  emailAndPassword: { enabled: true },
});

Additional context

this could be caused by a transpiler or bundler better-auth is using to load the config

Originally created by @huseeiin on GitHub (Mar 23, 2025). ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce ```ts import { betterAuth } from "better-auth"; import { DatabaseSync } from "node:sqlite"; export const auth = betterAuth({ database: new DatabaseSync("./sqlite.db"), emailAndPassword: { enabled: true }, }); ``` ### Current vs. Expected behavior node:sqlite is only available through the node: protocol ### What version of Better Auth are you using? 1.2.4 ### Provide environment information ```bash linux ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth"; import { DatabaseSync } from "node:sqlite"; export const auth = betterAuth({ database: new DatabaseSync("./sqlite.db"), emailAndPassword: { enabled: true }, }); ``` ### Additional context this could be caused by a transpiler or bundler better-auth is using to load the config
GiteaMirror added the bug label 2026-03-13 08:09:17 -05:00
Author
Owner

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

Hey,

You can pass using config the location of your config.

See https://www.better-auth.com/docs/adapters/sqlite for supported adapters 😊

@moshetanzer commented on GitHub (Mar 23, 2025): Hey, You can pass using config the location of your config. See https://www.better-auth.com/docs/adapters/sqlite for supported adapters 😊
Author
Owner

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

Hey @huseeiin did you manage to solve your issue?

@moshetanzer commented on GitHub (Mar 25, 2025): Hey @huseeiin did you manage to solve your issue?
Author
Owner

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

Hey @huseeiin did you manage to solve your issue?

i assume node:sqlite is not supported yet? is support planned?

@huseeiin commented on GitHub (Mar 25, 2025): > Hey [@huseeiin](https://github.com/huseeiin) did you manage to solve your issue? i assume node:sqlite is not supported yet? is support planned?
Author
Owner

@Kinfe123 commented on GitHub (Apr 12, 2025):

you can directly use sqlite - https://www.better-auth.com/docs/adapters/sqlite

@Kinfe123 commented on GitHub (Apr 12, 2025): you can directly use sqlite - https://www.better-auth.com/docs/adapters/sqlite
Author
Owner

@huseeiin commented on GitHub (Apr 12, 2025):

you can directly use sqlite - https://www.better-auth.com/docs/adapters/sqlite

is node:sqlite, which is different from better-sqlite3, supported?

@huseeiin commented on GitHub (Apr 12, 2025): > you can directly use sqlite - https://www.better-auth.com/docs/adapters/sqlite is node:sqlite, which is different from better-sqlite3, supported?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#904