diff --git a/packages/vite/src/node/server/transformRequest.ts b/packages/vite/src/node/server/transformRequest.ts index 5f48f03418f4dc..06133fadcd28ae 100644 --- a/packages/vite/src/node/server/transformRequest.ts +++ b/packages/vite/src/node/server/transformRequest.ts @@ -416,7 +416,7 @@ async function handleModuleSoftInvalidation( await init const source = transformResult.code const s = new MagicString(source) - const [imports] = parseImports(source) + const [imports] = parseImports(source, mod.id || undefined) for (const imp of imports) { let rawUrl = source.slice(imp.s, imp.e)