cli icon indicating copy to clipboard operation
cli copied to clipboard

Add debug logging for loading .env files

Open t-kelly opened this issue 1 year ago • 1 comments

WHY are these changes introduced?

I just spent 2+ hours trying to debug why I was receiving a 401 when running shopify theme dev. I understood from the debug logging that my Admin API session was invalid and https://theme-kit-access.shopifyapps.com/cli/admin/api/unstable/themes.json was failing, but even after running shopify auth logout I was not being prompted to login via browser (as I normally do).

Finally after adding some additional logging, I found that $SHOPIFY_CLI_THEME_TOKEN was being set. I had forgotten that I had created a .env file several weeks ago and it was setting the --password flag in this case

WHAT is this pull request doing?

Just knowing that a .env file is being loaded would have probably saved me a few hours of debugging. One-liner log to let people know that an .env file was found and being loaded.

Measuring impact

How do we know this change was effective? Please choose one:

  • [x] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • [ ] Existing analytics will cater for this addition
  • [ ] PR includes analytics changes to measure impact

Checklist

  • [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • [x] I've considered possible documentation changes

t-kelly avatar Jul 31 '24 16:07 t-kelly

CLA signed -- can you please re-run the status check?

t-kelly avatar Aug 02 '24 17:08 t-kelly

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

github-actions[bot] avatar Sep 02 '24 03:09 github-actions[bot]

This is still relevant -- let's get it merged team!

t-kelly avatar Nov 22 '24 18:11 t-kelly