Error: lockfile had changes, but lockfile is frozen

I and many others had this error message on building a project with bun.

On local workspace, this error is fixed by not putting a flag after bun install command.

Edit the asdf-bun script it’s not possible on Cloudflare Pages

I’m leaving the deployment log.

2023-11-18T10:38:06.120858Z	Cloning repository...
2023-11-18T10:38:06.993657Z	From https://github.com/curiogeek/curiogeek
2023-11-18T10:38:06.994328Z	 * branch            3c64b3a9651d2d4e37d3af0bcc0fc70f1061c956 -> FETCH_HEAD
2023-11-18T10:38:06.994525Z	
2023-11-18T10:38:07.038644Z	HEAD is now at 3c64b3a nextjs working
2023-11-18T10:38:07.039308Z	
2023-11-18T10:38:07.147092Z	
2023-11-18T10:38:07.180399Z	Success: Finished cloning repository files
2023-11-18T10:38:07.849882Z	Restoring from dependencies cache
2023-11-18T10:38:07.87201Z	Restoring from build output cache
2023-11-18T10:38:09.272187Z	Detected the following tools from environment: bun@latest, [email protected]
2023-11-18T10:38:09.272982Z	Installing bun latest
2023-11-18T10:38:09.713451Z	Downloading Bun v1.0.12...
2023-11-18T10:38:10.500003Z	Archive:  /tmp/asdf-bun.PDji/bun.zip
2023-11-18T10:38:11.30582Z	  inflating: /opt/buildhome/.asdf/downloads/bun/1.0.12/bun  
2023-11-18T10:38:11.384539Z	Installing Bun v1.0.12...
2023-11-18T10:38:11.527001Z	Bun v1.0.12 is installed successfully!
2023-11-18T10:38:12.223923Z	Installing project dependencies: bun install --frozen-lockfile
2023-11-18T10:38:12.509123Z	bun install v1.0.12 (85c99751)
2023-11-18T10:38:12.510525Z	error: lockfile had changes, but lockfile is frozen
2023-11-18T10:38:12.515604Z	Error: Exit with error code: 1
2023-11-18T10:38:12.515909Z	    at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
2023-11-18T10:38:12.516117Z	    at Object.onceWrapper (node:events:652:26)
2023-11-18T10:38:12.516312Z	    at ChildProcess.emit (node:events:537:28)
2023-11-18T10:38:12.516504Z	    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
2023-11-18T10:38:12.52417Z	Failed: build command exited with code: 1
2023-11-18T10:38:13.405076Z	Failed: error occurred while running build command

It is open to an issue on the GitHub repository of Bun, where others have reported the same error.

[error: lockfile had changes, but lockfile is frozen · Issue #5792 · oven-sh/bun (github.com)](https://github.com/oven-sh/bun/issues/5792)

I don’t know if asdf-bun repository is the same used by Cloudflare to deploy on Pages.

[cometkim/asdf-bun: asdf-vm plugin for installing Bun (github.com)](https://github.com/cometkim/asdf-bun)

1 Like

me too

Jarred Summer, the creator of Bun, fixed this.

Solution on GitHub

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.