Skip to content

Fix import.meta.url not being parsed as path properly #1903

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

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

0237h
Copy link
Collaborator

@0237h 0237h commented Jan 15, 2025

Using import.meta.url to resolve local file path and directories can lead to issues when special characters are percent-encoded in the url.

This fix uses the fileURLToPath native method to properly parse local urls to file paths.

Closes #1881

0237h added 2 commits January 15, 2025 12:37
Using `import.meta.url` to resolve local file path and directories can lead
to issues when special characters are percent-encoded in the url.

This fix uses the `fileURLToPath` native method to properly parse local urls
to file paths.
@0237h 0237h self-assigned this Jan 15, 2025
Copy link

changeset-bot bot commented Jan 15, 2025

🦋 Changeset detected

Latest commit: 85e72bb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphprotocol/graph-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@0237h 0237h requested a review from YaroShkvorets January 15, 2025 17:41
@YaroShkvorets YaroShkvorets self-requested a review January 16, 2025 21:23
Copy link
Collaborator

@YaroShkvorets YaroShkvorets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@YaroShkvorets YaroShkvorets merged commit bcaad5e into graphprotocol:main Jan 21, 2025
8 checks passed
incrypto32 pushed a commit that referenced this pull request Jan 30, 2025
* Fix `import.meta.url` not being parsed as path properly

Using `import.meta.url` to resolve local file path and directories can lead
to issues when special characters are percent-encoded in the url.

This fix uses the `fileURLToPath` native method to properly parse local urls
to file paths.

* Add changeset

* Remove regex and adjust path

* remove unnecessary platform check

---------

Co-authored-by: YaroShkvorets <shkvorets@gmail.com>
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.

graph init: whitespace in directory name
2 participants