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 (