diff --git a/packages/kit/src/compatibility.ts b/packages/kit/src/compatibility.ts index 8d610041d2..00ad74b67c 100644 --- a/packages/kit/src/compatibility.ts +++ b/packages/kit/src/compatibility.ts @@ -108,8 +108,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, '') }