Skip to content
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

Fix config not loading on Windows #483

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bdukes
Copy link
Contributor

@bdukes bdukes commented Jul 18, 2024

On my Windows machine, it was always printing this error message, even though there's a default config in place:

No elm-pages.config.mjs file found. Using default config.

Looking more deeply into it, the following error was being thrown from the import call:

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs.

This PR, therefore, always converts the file path into a file URL before attempting to import it.

Copy link

netlify bot commented Jul 18, 2024

👷 Deploy request for elm-pages-todos pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 5490822


export async function resolveConfig() {
const configPath = path.join(process.cwd(), "elm-pages.config.mjs");
const initialConfig = await await import(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just me being creepy, dad 😅
Saw this on the GH homepage, took a look becuase I was curious.

Suggested change
const initialConfig = await await import(
const initialConfig = await import(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants