From 2b57bfe36c7632e0379121559b31a153d1b80e35 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 16 Sep 2022 18:27:50 +0100 Subject: [PATCH] fix(nuxi): backward compatibility for kit <= rc.10 without `useNitro` (#7593) --- packages/nuxi/src/commands/build.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)