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

Migration Script Error #2448

Open
toddbrady opened this issue Apr 5, 2023 · 5 comments
Open

Migration Script Error #2448

toddbrady opened this issue Apr 5, 2023 · 5 comments

Comments

@toddbrady
Copy link

Migration Script Error on Windows
Running the migration script on Windows is returning an error, possibly a Node JS error.

To Reproduce
Steps to reproduce the behavior:

  1. Install latest CMS Design System from NPM
  2. In the console run the following command: npx cmsds-migrate
  3. Select: react button-migration
  4. See error

Error

!! Error: inquireForFile: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data are supported by the default ESM loader. 
On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'

Expected behavior
Help migrating the old Design System Buttons to the latest using 6.0+ of the Design System.

Windows laptop

  • Windows v10
  • Node v18.12.0
@pwolfert
Copy link
Collaborator

pwolfert commented Apr 5, 2023

Thanks for reporting this, @toddbrady. We're looking into this problem. It looks like Node expects a special prefix when importing ES modules by absolute paths on Windows because it doesn't quite understand roots like C:/. It wasn't something we tested for. If this is really time-sensitive and you have access to a UNIX machine, I suggest running it on that.

@forrestbaer
Copy link
Collaborator

Hey @toddbrady, are you able to run this in the WSL? We don't test or run any of our system in a windows environment.

@toddbrady
Copy link
Author

@forrestbaer Unfortunately not. The machine I have is fairly locked down. Outside of being able to run Git Bash, I don't have access to Linux.

@forrestbaer
Copy link
Collaborator

forrestbaer commented Apr 6, 2023

Bummer! Well since we don't have a windows environment to test in I'm hesitant to try to change something locally and hope it works for you. I will see about getting a windows license I can perhaps run in a VM, but in the meantime, if you'd like to work on this together I'd be happy to pair with you on your machine to adjust some things to see if we can get it working. You can PM me in slack user: BTZ8

Another option if you feel up to it would be to see if you can resolve the issue locally and submit a fix. The script and it's helpers are located in your node_modules/@cmgov/design-system@version/scripts/cmsds-migrate folder.

@toddbrady
Copy link
Author

Sure thing. Let me see what I can do in the next day or two. I'll see if I can modify the script directly in the npm package, and see what happens.

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

No branches or pull requests

3 participants