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: CLI module imports on windows #209

Merged
merged 9 commits into from
Aug 23, 2024
Merged

Conversation

KingOfTac
Copy link
Member

Pull Request

Description

This PR fixes an issue in the CLI when running in a Windows environment. The node implementation of import only works with file:// and data:// urls and not Windows file paths so this PR uses pathToFileURL to wrap the inputFilePath and convert it into a file url if it isn't already.

Issues

Reviewer Notes

@bheston
@nicholasrice
I won't be able to test on a Macbook for several hours so if either of you review this before then and would like to test this branch on a Unix environment, feel free.

Test Plan

Checklist

General

  • I have included a change request file using $ npm run change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation for this project.

Component-specific

  • I have added a new component
  • I have modified an existing component

⏭ Next Steps

@KingOfTac KingOfTac self-assigned this Jun 25, 2024
@KingOfTac KingOfTac requested a review from awentzel as a code owner June 25, 2024 18:41
@bheston
Copy link
Member

bheston commented Jun 26, 2024

Which node version are you running? I'm on 18.17.1 on Windows and it's been working when I run npx from within VSCode. Maybe they changed it in v20?

@KingOfTac
Copy link
Member Author

Which node version are you running?

I'm on 21

@KingOfTac
Copy link
Member Author

@bheston I have now tested on latest node version in both windows and Unix environments and the change added in this PR works across all the tested environments.

@nicholasrice
Copy link
Collaborator

Tested on Mac, seems to be working.

@bheston bheston merged commit 1befc91 into main Aug 23, 2024
2 checks passed
@bheston bheston deleted the users/kingoftac/fix-cli-windows branch August 23, 2024 20:40
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.

3 participants