Support bun new text-based lockfile

Since bun version 1.1.39, it supports new text-based lock file inplace of old binary lockfile. - https://bun.sh/blog/bun-v1.1.39#bun-lock-is-bun-s-new-text-based-lockfile - https://bun.sh/blog/bun-lock-text-lockfile In my repo, I replaced bun.lockb file with bun.lock But Cloudflare Pages can't detect that bun install --frozen-lockfile should be issued.
Using v2 root directory strategy
Success: Finished cloning repository files
Checking for configuration in a Wrangler configuration file (BETA)

No wrangler.toml file found. Continuing.
Detected the following tools from environment: [email protected], [email protected]
Installing bun 1.1.42
Downloading Bun v1.1.42...
Archive: /tmp/asdf-bun.ust9/bun.zip
inflating: /opt/buildhome/.asdf/downloads/bun/1.1.42/bun
Installing Bun v1.1.42...
Bun v1.1.42 is installed successfully!
Executing user command: bun run build
$ tsc && vite build
/usr/bin/bash: line 1: tsc: command not found
error: script "build" exited with code 127
Failed: Error while executing user command. Exited with error code: 127
Failed: build command exited with code: 1
Failed: error occurred while running build command
Using v2 root directory strategy
Success: Finished cloning repository files
Checking for configuration in a Wrangler configuration file (BETA)

No wrangler.toml file found. Continuing.
Detected the following tools from environment: [email protected], [email protected]
Installing bun 1.1.42
Downloading Bun v1.1.42...
Archive: /tmp/asdf-bun.ust9/bun.zip
inflating: /opt/buildhome/.asdf/downloads/bun/1.1.42/bun
Installing Bun v1.1.42...
Bun v1.1.42 is installed successfully!
Executing user command: bun run build
$ tsc && vite build
/usr/bin/bash: line 1: tsc: command not found
error: script "build" exited with code 127
Failed: Error while executing user command. Exited with error code: 127
Failed: build command exited with code: 1
Failed: error occurred while running build command
Current workaround is to include a bun.lockb file in repo. The file can be empty. It's used to make Cloudflare Pages know that we're using bun as package manager
Bun
Bun's new text-based lockfile
We're introducing a new text-based lockfile format for bun install. It's GitHub & git-friendly, and makes it easier for teams to migrate from npm, yarn, and pnpm to bun install
3 Replies
James
James4mo ago
cc @aniniflare
niclim
niclim3mo ago
may I know if this is supported yet? any progress?
thienandangthanh
thienandangthanhOP2d ago
As listed in this page, the tools of v2 build system still don't update the default version of Bun. It's still 1.1.33. https://developers.cloudflare.com/pages/configuration/build-image/ So I think it's not supported yet.
Cloudflare Docs
Build image · Cloudflare Pages docs
Cloudflare Pages' build environment has broad support for a variety of languages, such as Ruby, Node.js, Python, PHP, and Go.

Did you find this page helpful?