skip to content

Cloudflare Pages and Bun install mismatch

Growing

/ 1 min read

Updated:

Today I hit a Cloudflare Pages build failure where the local build passed, but the deployed build failed inside Vite/Tailwind:

[@tailwindcss/vite:generate:build] Missing field `tsconfigPaths` on BindingViteResolvePluginConfig.resolveOptions

The important part of the Cloudflare log was not the Tailwind error itself. It was the install/build mismatch:

Installing project dependencies: npm install --progress=false
Executing user command: bun run build

This repo uses bun.lock, but Cloudflare installed dependencies with npm. That means the deploy could resolve a different dependency graph than the local Bun install, then run the build with Bun against those npm-installed packages.

The local check was useful because bun run build passed with the committed Bun lockfile. That narrowed the issue to Cloudflare’s build environment and install strategy, not the app code.

The fix is to make Cloudflare use Bun for dependency installation too:

Terminal window
bun install --frozen-lockfile && bun run build

And set this Cloudflare Pages environment variable:

SKIP_DEPENDENCY_INSTALL=true

Optionally pin Bun as well:

BUN_VERSION=1.3.10

The lesson: when debugging static-site deploy failures, check the package manager used for installation separately from the package manager used for the build command. A passing local build does not mean much if the deploy is building against a different dependency tree.

Edit this page on GitHub

Comments

Local graph

No local links yet · full graph →