Shipping · 6 min
Fix a failed build
The most common build errors and how to fix them fast. Your live version is never affected.
Relax — a failed build never touches your live game. Players keep playing the last good version.
Most common causes
- No build script → add
"build": "vite build"(or your bundler) to package.json. - Works on my machine → commit your lockfile (
package-lock.json/pnpm-lock.yaml) so we install the same versions. - Case-sensitive paths →
Player.png≠player.pngon Linux build servers. - Blank screen after deploy → asset paths start with
/. Use relative paths / Vitebase: './'. - postinstall scripts → we install with
--ignore-scriptsfor safety. Don't rely on postinstall to generate files; do it inbuild. - Missing env vars → build-time env vars must have safe defaults; never commit secrets.
- TypeScript errors → the build fails on type errors if your build runs
tsc. Fix them or usevite buildonly. - Huge files → keep the output under 250 MB and single files under 50 MB.
Prompt: fix my STAIGE build
My game failed to build on STAIGE Games. STAIGE runs: install with --ignore-scripts, then my build command, on Linux (Node 20), and serves the output folder as static files. Here is the build log: <paste the log from Creator Studio here> Find the root cause, fix it in my repo, and make sure the build works from a clean clone (rm -rf node_modules && npm ci --ignore-scripts && npm run build).