fix(ci): convert Windows absolute paths to file URLs for dynamic imports #7126
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(ci): convert Windows absolute paths to file URLs for dynamic imports
The dynamic import in
importAlterationScript
was failing on Windows because it used an absolute file path without converting it to a valid file URL. This commit updates the code to usepathToFileURL
for converting file paths, resolving the ERR_UNSUPPORTED_ESM_URL_SCHEME error during database alteration deployment.Summary
This change fixes a bug where dynamic imports were failing on Windows due to the use of absolute file paths without the proper
file://
scheme. By converting these paths using Node'spathToFileURL
, the error is resolved and the deployment process works consistently across platforms.Testing
Tested on Windows by running the
logto db alt deploy
command with a sample database URL. Verified that the alterations deploy successfully without triggering the ERR_UNSUPPORTED_ESM_URL_SCHEME error, and confirmed that existing unit tests pass.Checklist
.changeset