From 693cd41a1c948169091b6a69ab0c9682c239ea98 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Tue, 14 Dec 2021 13:10:41 -0600 Subject: [PATCH] fix: wrap this.resolve with try/catch --- packages/astro/src/vite-plugin-config-alias/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/astro/src/vite-plugin-config-alias/index.ts b/packages/astro/src/vite-plugin-config-alias/index.ts index 15ae0bffc..6a6d6de8d 100644 --- a/packages/astro/src/vite-plugin-config-alias/index.ts +++ b/packages/astro/src/vite-plugin-config-alias/index.ts @@ -81,8 +81,10 @@ export default function configAliasVitePlugin(astroConfig: { projectRoot?: URL; name: '@astrojs/vite-plugin-config-alias', enforce: 'pre', async resolveId(sourceId: string, importer, options) { + try { /** Resolved ID conditionally handled by any other resolver. (this gives priority to all other resolvers) */ const resolvedId = await this.resolve(sourceId, importer, { skipSelf: true, ...options }); + } catch (e) {} // if any other resolver handles the file, return that resolution if (resolvedId) return resolvedId;