Skip to content

Commit b055812

Browse files
fix: JSR import
1 parent b658794 commit b055812

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dev/dev_build_cache.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ export class MemoryBuildCache<State> implements DevBuildCache<State> {
176176
await Promise.all(
177177
Array.from(this.islandModNameToChunk.entries()).map(
178178
async ([name, chunk]) => {
179-
const mod = await import(chunk.server);
179+
const fileUrl = path.toFileUrl(chunk.server);
180+
const mod = await import(fileUrl.href);
180181

181182
if (chunk.browser === null) {
182183
throw new Error(`Unexpected missing browser chunk`);
@@ -191,9 +192,10 @@ export class MemoryBuildCache<State> implements DevBuildCache<State> {
191192
async prepare(): Promise<void> {
192193
// Load FS routes
193194
const files = await Promise.all(this.#fsRoutes.files.map(async (file) => {
195+
const fileUrl = path.toFileUrl(file.filePath);
194196
return {
195197
...file,
196-
mod: await import(file.filePath),
198+
mod: await import(fileUrl.href),
197199
};
198200
}));
199201
this.#commands = fsItemsToCommands(files);

0 commit comments

Comments
 (0)