From e102d1d444dedb7231ed592197dce82dd29c750a Mon Sep 17 00:00:00 2001 From: Bobbie Goede Date: Fri, 12 Jul 2024 14:14:39 +0200 Subject: [PATCH] fix(kit): ensure `getNuxtVersion` returns `string` (#28125) --- packages/kit/src/compatibility.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kit/src/compatibility.ts b/packages/kit/src/compatibility.ts index b2720f05c9..b554493f7d 100644 --- a/packages/kit/src/compatibility.ts +++ b/packages/kit/src/compatibility.ts @@ -118,8 +118,8 @@ export function isNuxt3 (nuxt: Nuxt = useNuxt()) { */ export function getNuxtVersion (nuxt: Nuxt | any = useNuxt() /* TODO: LegacyNuxt */) { const rawVersion = nuxt?._version || nuxt?.version || nuxt?.constructor?.version - if (!rawVersion) { - throw new Error('Cannot determine nuxt version! Is current instance passed?') + if (typeof rawVersion !== 'string') { + throw new TypeError('Cannot determine nuxt version! Is current instance passed?') } return rawVersion.replace(/^v/g, '') }