Qwik "qwik build" command failed in CI
The qwik build script runs the client build, the server build, and the optimizer in sequence. A failure in any stage (adapter output, config, or a $ serialization error) aborts the whole build in CI.
What this error means
A npm run build step running qwik build stops with a Vite/optimizer error or a missing adapter step, and the CI job exits non-zero.
qwik
$ qwik build
vite v5 building for production...
[Qwik Optimizer Error] captured value is not serializable
Error: build.server failedCommon causes
A failing stage in the composite build
qwik build chains client, server, and lint/typecheck; any one failing (often the optimizer) fails the command.
A misconfigured build script or adapter
A custom script that drops the server build or lacks the adapter step produces an incomplete or failing build.
How to fix it
Read which stage failed and fix it
- Look at whether the error is in build.client, build.server, or the optimizer.
- Fix the underlying cause (serialization, missing adapter, or config).
- Keep the standard
qwik buildscript so all stages run in order.
package.json
{
"scripts": { "build": "qwik build" }
}Install cleanly first
Run npm ci so the Qwik CLI and plugins are present before the build.
Terminal
npm ci
npm run buildHow to prevent it
- Keep the standard
qwik buildscript intact. - Fix optimizer/serialization errors before they reach the server build.
- Use
npm ciso the Qwik toolchain is installed.
Related guides
Qwik build fails when qwikVite plugin is missing in CIFix Qwik "build failed" in CI when qwikVite / qwikCity plugins are missing from vite.config - Qwik JSX and $…
Qwik "Code ... captured ... but is not serializable" in CIFix Qwik "Code that is dynamically imported ... captured a value that is not serializable" in CI - a $ bounda…
QwikCity adapter not configured for the deploy target in CIFix QwikCity deploys that fail in CI because no adapter (static, express, cloudflare-pages, vercel-edge) matc…