diff --git a/packages/nuxt/src/pages/runtime/validate.ts b/packages/nuxt/src/pages/runtime/validate.ts index 263eab3cdc..ef8998dbe7 100644 --- a/packages/nuxt/src/pages/runtime/validate.ts +++ b/packages/nuxt/src/pages/runtime/validate.ts @@ -29,7 +29,9 @@ export default defineNuxtRouteMiddleware(async (to) => { // We pretend to have navigated to the invalid route so // that the user can return to the previous page with // the back button. - window?.history.pushState({}, '', to.fullPath) + if (typeof window !== 'undefined') { + window.history.pushState({}, '', to.fullPath) + } }) // We stop the navigation immediately before it resolves // if there is no other route matching it. diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index 35d340e2c4..9479ffd402 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -420,7 +420,7 @@ export default defineUntypedSchema({ /** * Keep showing the spa-loading-template until suspense:resolve - * @see [Nuxt Issues #24770](https://github.com/nuxt/nuxt/issues/21721) + * @see [Nuxt Issues #21721](https://github.com/nuxt/nuxt/issues/21721) * @type {'body' | 'within'} */ spaLoadingTemplateLocation: {