Skip to content

[windows] Specify the file:// protocol when importing config on Windows #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/witty-dots-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"open-next": patch
---

[windows] Specify the `file://` protocol when importing config on Windows
4 changes: 3 additions & 1 deletion packages/open-next/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ export async function build(

// Load open-next.config.ts
const tempDir = initTempDir();
const configPath = compileOpenNextConfigNode(
let configPath = compileOpenNextConfigNode(
tempDir,
openNextConfigPath,
nodeExternals,
);
// On Windows, we need to use file:// protocol to load the config file using import()
if (process.platform === "win32") configPath = `file://${configPath}`;
config = (await import(configPath)).default as OpenNextConfig;
validateConfig(config);

Expand Down
Loading