Build crashing after Bun 1.2

Netlify currently crashes in Bun projects due to Bun 1.2 missing in corepack (Currently set to Node 22.x), log:

1:05:02 PM: build-image version: 6724b7f630462a3bda7629c0c4b9c485399606e3 (noble)
1:05:02 PM: buildbot version: 6724b7f630462a3bda7629c0c4b9c485399606e3
1:05:02 PM: Fetching cached dependencies
1:05:02 PM: Starting to download cache of 512.7MB
1:05:03 PM: Finished downloading cache in 1.365s
1:05:03 PM: Starting to extract cache
1:05:08 PM: Finished extracting cache in 5.224s
1:05:08 PM: Finished fetching cache in 6.663s
1:05:08 PM: Starting to prepare the repo for build
1:05:09 PM: Preparing Git Reference refs/heads/main
1:05:10 PM: Starting to install dependencies
1:05:10 PM: Started restoring cached mise cache
1:05:11 PM: Finished restoring cached mise cache
1:05:12 PM: Python version set to 3.13.1
1:05:12 PM: Ruby version set to 2.7.2
1:05:12 PM: Go version set to 1.19
1:05:13 PM: Using PHP version 8.3
1:05:14 PM: Started restoring cached Node.js version
1:05:15 PM: Failed during stage 'Install dependencies': dependency_installation script returned non-zero exit code: 1
1:05:15 PM: Finished restoring cached Node.js version
1:05:15 PM: v22.13.1 is already installed.
1:05:15 PM: Now using node v22.13.1 (npm v10.9.2)
1:05:15 PM: Enabling Node.js Corepack
1:05:15 PM: Started restoring cached build plugins
1:05:15 PM: Finished restoring cached build plugins
1:05:15 PM: Started restoring cached corepack dependencies
1:05:15 PM: Finished restoring cached corepack dependencies
1:05:15 PM: Started restoring cached bun global cache
1:05:15 PM: Finished restoring cached bun global cache
1:05:15 PM: mise ERROR Tool not installed for shim: bun
1:05:15 PM: Missing tool version: core:bun@1.2.0
1:05:15 PM: Install all missing tools with: mise install
1:05:15 PM: mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information
1:05:15 PM: Installing npm packages using bun version
1:05:15 PM: mise ERROR Tool not installed for shim: bun
1:05:15 PM: Missing tool version: core:bun@1.2.0
1:05:15 PM: Install all missing tools with: mise install
1:05:15 PM: mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information
1:05:15 PM: Error during bun install
1:05:15 PM: Failing build: Failed to install dependencies

I tried:

  • Setting "packageManager": "bun@1.1.45" and "packageManager": "bun@1.2.0" in my package.json, still same error
  • Running the bun install script during build, same error (expected that since this is before build, but was worth a try)
  • Looking in the docs to find some bun version setting, BUN_VERSION variable, or some install step setting; could not find any

The only workaround I can think of is to delete my bun.lock file to get around the install detection, but I would prefer not to!

I’m using pnpm for now, but would love to see this fixed

1 Like

Hi @MapleLeaf , I’m experiencing the same issue. I think I found a workaround though, reverting to an older build image:

Site configuration > Build & Deploy > Build image selection > Configure and pick Ubuntu Focal 20.04

1 Like

That worked, thank you! Since it’s just a workaround, I won’t mark it as the solution, but it seems like it may be Ubuntu’s problem…? harsh if true

Do you have a reproduction to share?

Same issue here, today I decided to try bun instead of yarn as a package manager. Getting same log errors as @MapleLeaf

About the reproduction, would the code I am trying to deploy be useful?
aleksa-codes/astro-portfolio at bun

Thanks.

I tried your repo (bun branch), and it deployed fine: Deploy details | Deploys | f-138329 | Netlify

1 Like

I tried again and it failed but then tried again with “Clear cache and try with latest branch commit” and it worked. I appreciate your help, thanks!