diff --git a/lib/src/legacy/utils.ts b/lib/src/legacy/utils.ts index 7a72472f..4e379e2f 100644 --- a/lib/src/legacy/utils.ts +++ b/lib/src/legacy/utils.ts @@ -38,7 +38,13 @@ export function removeLegacyImporter(string: string): string { // syntax. export function removeLegacyImporterFromSpan(span: SourceSpan): SourceSpan { if (!span.url) return span; - return {...span, url: new URL(removeLegacyImporter(span.url.toString()))}; + return { + ...span, + url: new URL( + removeLegacyImporter(span.url.toString()), + pathToFileURL(process.cwd()) + ), + }; } // Converts [path] to a `file:` URL and adds the [legacyImporterProtocolPrefix]