diff --git a/packages/nuxt/src/app/components/nuxt-island.ts b/packages/nuxt/src/app/components/nuxt-island.ts index 784132a752..93832a1eaf 100644 --- a/packages/nuxt/src/app/components/nuxt-island.ts +++ b/packages/nuxt/src/app/components/nuxt-island.ts @@ -1,4 +1,4 @@ -import type { Component, PropType } from 'vue' +import type { Component, PropType, VNode } from 'vue' import { Fragment, Teleport, computed, createStaticVNode, createVNode, defineComponent, getCurrentInstance, h, nextTick, onMounted, ref, toRaw, watch, withMemo } from 'vue' import { debounce } from 'perfect-debounce' import { hash } from 'ohash' @@ -29,7 +29,7 @@ const getId = import.meta.client ? () => (id++).toString() : randomUUID const components = import.meta.client ? new Map() : undefined async function loadComponents (source = appBaseURL, paths: NuxtIslandResponse['components']) { - const promises = [] + const promises: Array> = [] for (const component in paths) { if (!(components!.has(component))) { @@ -259,7 +259,7 @@ export default defineComponent({ // should away be triggered ONE tick after re-rendering the static node withMemo([teleportKey.value], () => { - const teleports = [] + const teleports: Array = [] // this is used to force trigger Teleport when vue makes the diff between old and new node const isKeyOdd = teleportKey.value === 0 || !!(teleportKey.value && !(teleportKey.value % 2)) diff --git a/packages/nuxt/src/app/components/utils.ts b/packages/nuxt/src/app/components/utils.ts index a5e918a89d..3de363755d 100644 --- a/packages/nuxt/src/app/components/utils.ts +++ b/packages/nuxt/src/app/components/utils.ts @@ -86,7 +86,7 @@ export function vforToArray (source: any): any[] { if (import.meta.dev && !Number.isInteger(source)) { console.warn(`The v-for range expect an integer value but got ${source}.`) } - const array = [] + const array: number[] = [] for (let i = 0; i < source; i++) { array[i] = i } diff --git a/packages/nuxt/src/core/nuxt.ts b/packages/nuxt/src/core/nuxt.ts index 20d59295dc..b054abb923 100644 --- a/packages/nuxt/src/core/nuxt.ts +++ b/packages/nuxt/src/core/nuxt.ts @@ -698,7 +698,7 @@ const RESTART_RE = /^(?:app|error|app\.config)\.(?:js|ts|mjs|jsx|tsx|vue)$/i function deduplicateArray (maybeArray: T): T { if (!Array.isArray(maybeArray)) { return maybeArray } - const fresh = [] + const fresh: any[] = [] const hashes = new Set() for (const item of maybeArray) { const _hash = hash(item) diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index f33a9774aa..4321a2387a 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -400,7 +400,7 @@ export default defineRenderHandler(async (event): Promise