Skip to content

Commit

Permalink
Fix dev resolution of client modules on Windows (#2768)
Browse files Browse the repository at this point in the history
* Fix dev resolution of client modules on Windows

* Adds a changeset
  • Loading branch information
matthewp committed Mar 11, 2022
1 parent d4dbfe8 commit 49c0d99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/strange-kings-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes loading astro/client/\* on Windows in dev
3 changes: 2 additions & 1 deletion packages/astro/src/core/render/dev/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { RouteCache } from '../route-cache.js';
import { resolveRenderers } from './renderers.js';
import { errorHandler } from './error.js';
import { getHmrScript } from './hmr.js';
import { prependForwardSlash } from '../../path.js';
import { render as coreRender } from '../core.js';
import { createModuleScriptElementWithSrcSet } from '../ssr-element.js';

Expand Down Expand Up @@ -103,7 +104,7 @@ export async function render(renderers: Renderer[], mod: ComponentInstance, ssrO
// broken in the legacy build. This can be removed once the legacy build is removed.
if (!astroConfig.buildOptions.legacyBuild) {
const [, resolvedPath] = await viteServer.moduleGraph.resolveUrl(s);
return resolvedPath;
return '/@fs' + prependForwardSlash(resolvedPath);
} else {
return s;
}
Expand Down

0 comments on commit 49c0d99

Please sign in to comment.