I was getting the same random issues on Vercel (possibly from a mix of Bun and Node environments).
Steps I took:
-
Removed
bun.lock,node_modules, andpackage-lock.json -
Made sure all my
package.jsonscripts use Node commands (removed anybunreferences) -
Matched my local Node version to Vercel’s (
20.x) -
Locally run
npm installand commit updatedpackage.jsonandpackage-lock.json -
In Vercel → Settings → Build & Development → Framework Settings, set:
-
Build Command:
npm run build -
Install Command:
npm ci
-
-
Deploy
vercel --force
This setup seems to have resulted in a stable environment for me (for now)