diff --git a/packages/nuxt/src/app/composables/error.ts b/packages/nuxt/src/app/composables/error.ts index 019be2ccfe..6a8b2ff75c 100644 --- a/packages/nuxt/src/app/composables/error.ts +++ b/packages/nuxt/src/app/composables/error.ts @@ -1,7 +1,9 @@ import type { H3Error } from 'h3' import { createError as createH3Error } from 'h3' import { toRef } from 'vue' +import type { Ref } from 'vue' import { useNuxtApp } from '../nuxt' +import type { NuxtPayload } from '../nuxt' import { useRouter } from './router' // @ts-expect-error virtual file @@ -10,7 +12,7 @@ import { nuxtDefaultErrorValue } from '#build/nuxt.config.mjs' export const NUXT_ERROR_SIGNATURE = '__nuxt_error' /** @since 3.0.0 */ -export const useError = () => toRef(useNuxtApp().payload, 'error') +export const useError = (): Ref => toRef(useNuxtApp().payload, 'error') // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface NuxtError extends H3Error {}