integrating-better-auth-better-sqlite3-drizzle-pnpm ─ □ ×

Integrate Better Auth with Better SQLite3 and Drizzle

so you want to integrate better-auth with better-sqlite3 and drizzle? you might face this error Error: Could not locate the bindings file.

Solution

you need to update your package.json under pnpm to this

{
  ...,
  "pnpm": {
    "onlyBuiltDependencies": [
      "esbuild",
      "better-sqlite3"
    ]
  }

Then delete your node_modules and you good to go

References

https://github.com/WiseLibs/better-sqlite3/issues/146