elm-pages
elm-pages copied to clipboard
Fix config not loading on Windows
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.