Qwik "Cannot find module '@builder.io/qwik-city'" in CI
The build could not resolve @builder.io/qwik-city, the routing and server layer for Qwik. It is either missing from dependencies, mislabeled as a dev dependency, or the install step did not run before the build.
What this error means
A qwik build or vite build step fails with "Cannot find module '@builder.io/qwik-city'" or a Rollup resolve error for that import, while it builds locally.
node
[vite]: Rollup failed to resolve import "@builder.io/qwik-city" from
"src/root.tsx".
Error: Cannot find module '@builder.io/qwik-city'Common causes
qwik-city missing from dependencies
It was installed locally but never saved, so a clean CI install does not include it.
A production install pruned it
npm ci --omit=dev removed it if it was miscategorized, breaking the build.
How to fix it
Install and save qwik-city
- Install
@builder.io/qwik-cityand save it todependencies. - Commit
package.jsonand the lockfile. - Use
npm ciin CI to honor the lockfile.
Terminal
npm install @builder.io/qwik-city
git add package.json package-lock.jsonKeep build-needed packages in the install
Do not omit deps the build compiles against.
.github/workflows/ci.yml
npm ciHow to prevent it
- Keep
@builder.io/qwik-cityindependencies. - Use
npm ciagainst a committed lockfile. - Avoid pruning deps the build needs.
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 $…
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…
SolidJS "Cannot find module 'solid-js'" in CIFix "Cannot find module 'solid-js'" in CI - the core Solid package is not installed in the runner environment…