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): load file with native pathToFileURL() #8

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

caiodomingues
Copy link
Contributor

getConfig() was failing to load languine.config.mjs:

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. Received protocol 'e:'

Changed the import() to use the native pathToFileURL() before loading the file to prevent the error. It's cross-platform and also normalizes Windows drive letters/relative paths.

Tests:

  • ✅ Windows from drive-based path (E:\)
  • ✅ Linux
  • ✅ MacOS

Copy link

vercel bot commented Dec 23, 2024

@caiodomingues is attempting to deploy a commit to the Pontus Abrahamsson's projects Team on Vercel.

A member of the Team first needs to authorize it.

@pontusab pontusab merged commit 895c902 into midday-ai:main Dec 23, 2024
1 check failed
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