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(ConfigManager): Resolve ESM import exception on Windows #460

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RandomByte
Copy link
Member

@RandomByte RandomByte commented Jan 3, 2025

import(path) does not accept absolute Windows-paths since those seem to get confused with URLs.

Before, this was mitigated by always calculating a relative path (relative to the UI5 linter install directory). This however breaks on Windows if the target project is located on another drive as reported in #458

Instead convert all paths to file://-URLs before passing them to import().

Also, in linter.ts, enforce the project root path to always be absolute to simplify handling the path later on.

Resolves #458

@RandomByte RandomByte force-pushed the config-manager-import-win32 branch from 9527181 to 954ead3 Compare January 3, 2025 10:22
import(path) does not accept absolute Windows-paths since those seem to
get confused with URLs.

Before, this was mitigated by always calculating a relative path
(relative to the UI5 linter install directory). This however breaks on
Windows if the target project is located on another drive as reported in
#458

Instead convert all paths to "file://"-URLs before passing them to
import().

Also, in linter.ts, enforce the project root path to always be absolute
to simplify handling the path later on.

Resolves #458
@RandomByte RandomByte force-pushed the config-manager-import-win32 branch from 954ead3 to 15b7d61 Compare January 3, 2025 11:08
@RandomByte RandomByte requested review from d3xter666 and a team January 3, 2025 11:09
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.

crashes with error ERR_UNSUPPORTED_ESM_URL_SCHEME on Windows with cwd on D:
1 participant