elm-pages icon indicating copy to clipboard operation
elm-pages copied to clipboard

Fix config not loading on Windows

Open bdukes opened this issue 7 months ago • 1 comments

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.

bdukes avatar Jul 18 '24 02:07 bdukes