From ff96f62e7ad14987ad0413f64e65cb22d63c0cdb Mon Sep 17 00:00:00 2001 From: Mert Sincan Date: Sun, 30 Jun 2024 21:33:35 +0100 Subject: [PATCH] Fixed #5980 - Nuxt module component autoImport in v4 rc3 doesn't work with component prefixes --- packages/auto-import-resolver/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/auto-import-resolver/index.ts b/packages/auto-import-resolver/index.ts index d5594316e..ca04eefc2 100644 --- a/packages/auto-import-resolver/index.ts +++ b/packages/auto-import-resolver/index.ts @@ -28,7 +28,7 @@ export function PrimeVueResolver(options: PrimeVueResolverOptions = {}): Compone resolve: (name: string) => { const { prefix } = options.components || {}; const cName = getName(name, prefix); - const cMeta = components.find((c) => c.name.toLocaleLowerCase() === cName.toLocaleLowerCase()); + const cMeta = components.find((c) => c.name.toLocaleLowerCase() === cName?.toLocaleLowerCase()); if (cMeta) { return ( @@ -44,7 +44,7 @@ export function PrimeVueResolver(options: PrimeVueResolverOptions = {}): Compone resolve: (name: string) => { const { prefix } = options.directives || {}; const dName = getName(name, prefix); - const dMeta = directives.find((d) => d.name.toLocaleLowerCase() === dName.toLocaleLowerCase()); + const dMeta = directives.find((d) => d.name.toLocaleLowerCase() === dName?.toLocaleLowerCase()); if (dMeta) { return (