[GH-ISSUE #5461] Can't build in 1.3.28 #10255

Closed
opened 2026-04-13 06:15:25 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @Suniron on GitHub (Oct 21, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/5461

To Reproduce

  1. Create an application using better auth in 1.3.28 as a dependency
  2. Write a Dockerfile using oven/bun:1.3.0-slim as base to avoid having python installed
  3. Add an instruction to install dependencies: RUN bun install
  4. Build the Docker image

Current vs. Expected behavior

You should have an error about better-sqlite3 installation fails without the Python executable:

bun install v1.3.0 (b0a6feca)
warn: Slow filesystem detected. If /root/.bun/install/cache is a network drive, consider setting $BUN_INSTALL_CACHE_DIR to a local folder.
Resolving dependencies
Resolved, downloaded and extracted [108]
node: symbol lookup error: /builds/my-app/node_modules/.bun/better-sqlite3@12.4.1/node_modules/better-sqlite3/build/Release/better_sqlite3.node: undefined symbol: _ZN2v816FunctionTemplate16InstanceTemplateEv
gyp info it worked if it ends with ok
gyp info using node-gyp@11.5.0
gyp info using node@24.3.0 | linux | x64
gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - executable path is ""
gyp ERR! find Python - "" could not be run
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - executable path is ""
gyp ERR! find Python - "" could not be run
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at fail (/tmp/bunx-0-node-gyp@latest/node_modules/node-gyp/lib/find-python.js:306:15)
gyp ERR! stack at async configure (/tmp/bunx-0-node-gyp@latest/node_modules/node-gyp/lib/configure.js:27:24)
gyp ERR! stack at async run (/tmp/bunx-0-node-gyp@latest/node_modules/node-gyp/bin/node-gyp.js:81:46)
gyp ERR! stack at processTicksAndRejections (native:7:39)
gyp ERR! System Linux 6.8.0-64-generic
gyp ERR! command "/usr/local/bin/bun" "/tmp/bunx-0-node-gyp@latest/node_modules/.bin/node-gyp" "rebuild" "--release"
gyp ERR! cwd /builds/my-app/node_modules/.bun/better-sqlite3@12.4.1/node_modules/better-sqlite3
gyp ERR! node -v v24.3.0
gyp ERR! node-gyp -v v11.5.0
gyp ERR! not ok 
error: install script from "better-sqlite3" exited with 1

The problem does not appear with the previous better-auth version

What version of Better Auth are you using?

1.3.28

System info

In the slim docker image of the latest Bun (1.3.0)

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

Package

Additional context

I have this problem locally, but also in my GitLab jobs.

It's the same problème with the last version of bun: 1.2.23.

I don't have any error if I force the previous version of better-auth in package.json files, like: "better-auth": "1.3.27"

Originally created by @Suniron on GitHub (Oct 21, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/5461 ### To Reproduce 1. Create an application using better auth in 1.3.28 as a dependency 2. Write a Dockerfile using `oven/bun:1.3.0-slim` as base to avoid having python installed 3. Add an instruction to install dependencies: `RUN bun install` 4. Build the Docker image ### Current vs. Expected behavior You should have an error about better-sqlite3 installation fails without the Python executable: ``` bun install v1.3.0 (b0a6feca) warn: Slow filesystem detected. If /root/.bun/install/cache is a network drive, consider setting $BUN_INSTALL_CACHE_DIR to a local folder. Resolving dependencies Resolved, downloaded and extracted [108] node: symbol lookup error: /builds/my-app/node_modules/.bun/better-sqlite3@12.4.1/node_modules/better-sqlite3/build/Release/better_sqlite3.node: undefined symbol: _ZN2v816FunctionTemplate16InstanceTemplateEv gyp info it worked if it ends with ok gyp info using node-gyp@11.5.0 gyp info using node@24.3.0 | linux | x64 gyp ERR! find Python gyp ERR! find Python Python is not set from command line or npm configuration gyp ERR! find Python Python is not set from environment variable PYTHON gyp ERR! find Python checking if "python3" can be used gyp ERR! find Python - executable path is "" gyp ERR! find Python - "" could not be run gyp ERR! find Python checking if "python" can be used gyp ERR! find Python - executable path is "" gyp ERR! find Python - "" could not be run gyp ERR! find Python gyp ERR! find Python ********************************************************** gyp ERR! find Python You need to install the latest version of Python. gyp ERR! find Python Node-gyp should be able to find and use Python. If not, gyp ERR! find Python you can try one of the following options: gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable" gyp ERR! find Python (accepted by both node-gyp and npm) gyp ERR! find Python - Set the environment variable PYTHON gyp ERR! find Python - Set the npm configuration variable python: gyp ERR! find Python npm config set python "/path/to/pythonexecutable" gyp ERR! find Python For more information consult the documentation at: gyp ERR! find Python https://github.com/nodejs/node-gyp#installation gyp ERR! find Python ********************************************************** gyp ERR! find Python gyp ERR! configure error gyp ERR! stack Error: Could not find any Python installation to use gyp ERR! stack at fail (/tmp/bunx-0-node-gyp@latest/node_modules/node-gyp/lib/find-python.js:306:15) gyp ERR! stack at async configure (/tmp/bunx-0-node-gyp@latest/node_modules/node-gyp/lib/configure.js:27:24) gyp ERR! stack at async run (/tmp/bunx-0-node-gyp@latest/node_modules/node-gyp/bin/node-gyp.js:81:46) gyp ERR! stack at processTicksAndRejections (native:7:39) gyp ERR! System Linux 6.8.0-64-generic gyp ERR! command "/usr/local/bin/bun" "/tmp/bunx-0-node-gyp@latest/node_modules/.bin/node-gyp" "rebuild" "--release" gyp ERR! cwd /builds/my-app/node_modules/.bun/better-sqlite3@12.4.1/node_modules/better-sqlite3 gyp ERR! node -v v24.3.0 gyp ERR! node-gyp -v v11.5.0 gyp ERR! not ok error: install script from "better-sqlite3" exited with 1 ``` The problem does not appear with the previous better-auth version ### What version of Better Auth are you using? 1.3.28 ### System info ```bash In the slim docker image of the latest Bun (1.3.0) ``` ### Which area(s) are affected? (Select all that apply) Package ### Additional context I have this problem locally, but also in my GitLab jobs. It's the same problème with the last version of bun: **1.2.23**. I don't have any error if I force the previous version of **better-auth** in package.json files, like: `"better-auth": "1.3.27"`
GiteaMirror added the lockedbug labels 2026-04-13 06:15:25 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 21, 2025):

Hi @Suniron! I'm Dosu and I’m helping the better-auth team.

This build failure is a known issue with better-auth 1.3.28 and Bun slim images. The root cause is the upgrade of the better-sqlite3 dependency to v12.x in better-auth 1.3.28, which requires native compilation via node-gyp and Python—even if you aren't using SQLite directly. This requirement was introduced or changed in 1.3.28; previous versions like 1.3.27 did not trigger this problem in slim environments without Python see details.

There’s no official fix for avoiding the Python/build tools requirement in slim images. The recommended workaround is to use a multi-stage Docker build: install Python and build-essential packages in the build stage before running bun install, then copy the built app to a slim image for production example. Alternatively, you can pin better-auth to 1.3.27 if you don’t need the newer features or fixes.

Let me know if you want a sample Dockerfile or more details on multi-stage builds!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3426938026 --> @dosubot[bot] commented on GitHub (Oct 21, 2025): <!-- Greeting --> Hi @Suniron! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> This build failure is a known issue with better-auth 1.3.28 and Bun slim images. The root cause is the upgrade of the better-sqlite3 dependency to v12.x in better-auth 1.3.28, which requires native compilation via node-gyp and Python—even if you aren't using SQLite directly. This requirement was introduced or changed in 1.3.28; previous versions like 1.3.27 did not trigger this problem in slim environments without Python [see details](https://github.com/better-auth/better-auth/pull/5197). There’s no official fix for avoiding the Python/build tools requirement in slim images. The recommended workaround is to use a multi-stage Docker build: install Python and build-essential packages in the build stage before running `bun install`, then copy the built app to a slim image for production [example](https://github.com/better-auth/better-auth/issues/2283). Alternatively, you can pin better-auth to 1.3.27 if you don’t need the newer features or fixes. Let me know if you want a sample Dockerfile or more details on multi-stage builds! <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/152125d2-7377-4c4d-a9bd-07983822bf00?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/152125d2-7377-4c4d-a9bd-07983822bf00?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/152125d2-7377-4c4d-a9bd-07983822bf00?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/152125d2-7377-4c4d-a9bd-07983822bf00?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/152125d2-7377-4c4d-a9bd-07983822bf00?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/152125d2-7377-4c4d-a9bd-07983822bf00?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/152125d2-7377-4c4d-a9bd-07983822bf00?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/5461)
Author
Owner

@Bekacru commented on GitHub (Oct 21, 2025):

Are you using better-sqlite3?

<!-- gh-comment-id:3428613282 --> @Bekacru commented on GitHub (Oct 21, 2025): Are you using better-sqlite3?
Author
Owner

@Suniron commented on GitHub (Oct 21, 2025):

Are you using better-sqlite3?

Not at all.. it's just a dependency of better auth, I believe.

<!-- gh-comment-id:3428670256 --> @Suniron commented on GitHub (Oct 21, 2025): > Are you using better-sqlite3? Not at all.. it's just a dependency of better auth, I believe.
Author
Owner

@himself65 commented on GitHub (Oct 21, 2025):

Thanks for the report. Seems like I mistakenly added it to peer dep.

<!-- gh-comment-id:3428865855 --> @himself65 commented on GitHub (Oct 21, 2025): Thanks for the report. Seems like I mistakenly added it to peer dep.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#10255