Skip to content

Commit 51fc810

Browse files
Aldthonyteemingc
andauthored
fix: avoid file import that is incompatible with Windows (#13495)
* fix: avoid file import that is incompatible with Windows * add changeset * Update packages/adapter-netlify/index.js * Update .changeset/eight-walls-melt.md --------- Co-authored-by: Tee Ming <[email protected]>
1 parent ef1e804 commit 51fc810

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/eight-walls-melt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-netlify': patch
3+
---
4+
5+
fix: correctly import manifest on Windows machines

packages/adapter-netlify/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ async function generate_edge_functions({ builder }) {
143143
writeFileSync(`${tmp}/manifest.js`, `export const manifest = ${manifest};\n`);
144144

145145
/** @type {{ assets: Set<string> }} */
146-
const { assets } = (await import(`${tmp}/manifest.js`)).manifest;
146+
// we have to prepend the file:// protocol because Windows doesn't support absolute path imports
147+
const { assets } = (await import(`file://${tmp}/manifest.js`)).manifest;
147148

148149
const path = '/*';
149150
// We only need to specify paths without the trailing slash because

0 commit comments

Comments
 (0)