diff --git a/.changeset/wild-ladybugs-flash.md b/.changeset/wild-ladybugs-flash.md new file mode 100644 index 0000000000..e683b78d9b --- /dev/null +++ b/.changeset/wild-ladybugs-flash.md @@ -0,0 +1,5 @@ +--- +'@lit-labs/ssr': patch +--- + +Use `url` module to parse file URL to path for Windows compatibility diff --git a/packages/labs/ssr/src/lib/module-loader.ts b/packages/labs/ssr/src/lib/module-loader.ts index eb233bf538..b6b6e00e3a 100644 --- a/packages/labs/ssr/src/lib/module-loader.ts +++ b/packages/labs/ssr/src/lib/module-loader.ts @@ -131,7 +131,7 @@ export class ModuleLoader { if (moduleURL.protocol !== 'file:') { throw new Error(`Unsupported protocol: ${moduleURL.protocol}`); } - const modulePath = moduleURL.pathname; + const modulePath = fileURLToPath(moduleURL); // Look in the cache let moduleRecord = this.cache.get(modulePath);