From 1a375d638c67eaa1b4b69d51608d1610d8273938 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sun, 6 Oct 2024 06:17:34 +0100 Subject: [PATCH] fix: ensure importer is normalised before resolving relative imports --- packages/nuxt/src/core/plugins/virtual.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/nuxt/src/core/plugins/virtual.ts b/packages/nuxt/src/core/plugins/virtual.ts index 2d884ca1fa..95278916ec 100644 --- a/packages/nuxt/src/core/plugins/virtual.ts +++ b/packages/nuxt/src/core/plugins/virtual.ts @@ -43,6 +43,9 @@ export const VirtualFSPlugin = (nuxt = useNuxt(), options: VirtualFSPluginOption } if (importer && !isAbsolute(id)) { + if (importer.startsWith(PREFIX)) { + importer = importer.slice(PREFIX.length) + } const resolved = resolveWithExt(join(dirname(importer), id)) if (resolved) { return PREFIX + resolved