diff --git a/packages/nuxt/src/pages/module.ts b/packages/nuxt/src/pages/module.ts index ba8c0a807d..b08b5c948c 100644 --- a/packages/nuxt/src/pages/module.ts +++ b/packages/nuxt/src/pages/module.ts @@ -644,6 +644,7 @@ if (import.meta.hot) { export function handleHotUpdate(_router) { if (import.meta.hot) { + import.meta.hot.data ||= {} import.meta.hot.data.router = _router } }