Skip to content
Latchkey

Nuxt Nitro "Cannot resolve preset" deployment error in CI

Nitro builds the server for a named preset (node-server, static, vercel, cloudflare). When the configured preset name is misspelled or not a known target, Nitro cannot resolve it and the build fails.

What this error means

nuxt build fails with "Cannot resolve preset \"X\"" or "Unknown preset" naming the value from nitro.preset or the NITRO_PRESET environment variable.

nuxt
ERROR Cannot resolve preset "cloudflare-page"
  at resolvePreset (node_modules/nitropack/dist/...)

Common causes

A misspelled or nonexistent preset name

The preset string does not match a real Nitro target (for example cloudflare-page instead of cloudflare-pages), so resolution fails.

NITRO_PRESET set to a wrong value in CI

A NITRO_PRESET environment variable in the workflow overrides config with an invalid target.

How to fix it

Set a valid preset name

Use the exact preset for your deploy target in Nuxt config.

nuxt.config.ts
export default defineNuxtConfig({
  nitro: { preset: 'node-server' }
});

Correct the NITRO_PRESET env value

Fix or remove the environment override so it names a real preset.

.github/workflows/deploy.yml
env:
  NITRO_PRESET: cloudflare-pages

How to prevent it

  • Use exact, documented Nitro preset names.
  • Keep NITRO_PRESET consistent with the deploy target.
  • Avoid setting the preset in two places that can drift.

Frequently asked questions

What causes "Nitro "Cannot resolve preset""?
The preset string does not match a real Nitro target (for example cloudflare-page instead of cloudflare-pages), so resolution fails.
How do I fix Nitro "Cannot resolve preset"?
Use the exact preset for your deploy target in Nuxt config.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card