Bun not detected as tool when using new bun.lock instead of bun.lockb

For Workers & Pages, what is the name of the domain?

N/A

What is the issue or error you’re encountering

Since v1.2, bun creates its lock file as a text-based file (bun.lock) instead of the previous binary format (bun.lockb). When creating a new Cloudflare Pages project, the new bun.lock is not being detected and as such, bun is not detected as tool for this project. This means that instead of running bun install ..., it runs npm install ... which makes the build process significantly slower.

What are the steps to reproduce the issue?

  1. Create a bun project using bun >= 1.2, check it generates the new lock file: bun.lock
  2. Deploy it as a Cloudflare Page.
  3. Check the deployment logs, it won’t use bun to install the projects dependencies. It will use npm instead.
1 Like

You can trigger Bun detection + dependency installation by creating an empty bun.lockb (touch bun.lockb) file in your project’s root directory, as a workaround.

This works because Bun v1.2+ by default prioritizes bun.lock file over bun.lockb (Lockfile – Package manager | Bun Docs)