We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 560b1e7 commit 36aa855Copy full SHA for 36aa855
packages/utils/src/lib/import-module.ts
@@ -34,7 +34,7 @@ export function toFileUrl(filepath: string): string {
34
if (windowsAbsolutePathMatch) {
35
const [, drive, rest] = windowsAbsolutePathMatch;
36
// Normalize backslashes to forward slashes and construct file URL manually
37
- const normalizedPath = `${drive}${rest.replace(/\\/g, '/')}`;
+ const normalizedPath = `${drive}${rest?.replace(/\\/g, '/')}`;
38
return `file:///${normalizedPath}`;
39
}
40
return pathToFileURL(filepath).href;
0 commit comments