diff --git a/packages/astro/src/content/data-store.ts b/packages/astro/src/content/data-store.ts index 36f19065ef07a..c8e70b47c3aac 100644 --- a/packages/astro/src/content/data-store.ts +++ b/packages/astro/src/content/data-store.ts @@ -473,7 +473,7 @@ function dataStoreSingleton() { // TODO: find a better place to put this image export function contentModuleToId(fileName: string, specifier: string) { const params = new URLSearchParams(specifier); - params.set('importer', fileName); + params.set('fileName', fileName); params.set(DEFERRED_MODULE, 'true'); return `${specifier}?${params.toString()}`; } diff --git a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts index 36dc36c4bab89..be167bc3a70b6 100644 --- a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts +++ b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts @@ -80,10 +80,10 @@ export function astroContentVirtualModPlugin({ if (isDeferredModule(id)) { const [, query] = id.split('?'); const params = new URLSearchParams(query); - const importerParam = params.get('importer'); + const fileName = params.get('fileName'); let importerPath = undefined; - if (importerParam && URL.canParse(importerParam, settings.config.root.toString())) { - importerPath = fileURLToPath(new URL(importerParam, settings.config.root)); + if (fileName && URL.canParse(fileName, settings.config.root.toString())) { + importerPath = fileURLToPath(new URL(fileName, settings.config.root)); } if (importerPath) { return await this.resolve(importerPath);