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.
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.
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.
env:
NITRO_PRESET: cloudflare-pagesHow to prevent it
- Use exact, documented Nitro preset names.
- Keep
NITRO_PRESETconsistent with the deploy target. - Avoid setting the preset in two places that can drift.