From 07cd6346465c3ef3c33eb7773b4867fc8a9ed525 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 27 Nov 2024 14:02:44 +0000 Subject: [PATCH] fix: set default `spaPreloaderOutside` when `compatibilityVersion: 4` --- packages/schema/src/config/experimental.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index 9396527ef4..6393bea03d 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -412,6 +412,10 @@ export default defineUntypedSchema({ * Keep showing the spa-loading-template until suspense:resolve * @see [Nuxt Issues #24770](https://github.com/nuxt/nuxt/issues/21721) */ - spaPreloaderOutside: false, + spaPreloaderOutside: { + $resolve: async (val, get) => { + return val ?? ((await get('future') as Record).compatibilityVersion === 4) + }, + }, }, })