diff --git a/packages/nuxi/src/commands/build.ts b/packages/nuxi/src/commands/build.ts index c6e19f396b..b2868355a0 100644 --- a/packages/nuxi/src/commands/build.ts +++ b/packages/nuxi/src/commands/build.ts @@ -28,7 +28,8 @@ export default defineNuxtCommand({ } }) - const nitro = useNitro() + // Use ? for backward compatibility for Nuxt <= RC.10 + const nitro = useNitro?.() await clearDir(nuxt.options.buildDir)