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

[Bug]: shopify app deploy automatically selects client-id, if not provided #5053

Closed
2 tasks done
Goondrious opened this issue Dec 7, 2024 · 2 comments
Closed
2 tasks done
Labels
Area: @shopify/app @shopify/app package issues State: Waiting for feedback Type: Bug Something isn't working

Comments

@Goondrious
Copy link

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

App

Expected behavior

shopify app deploy should deploy the config specified via shopify app config use or --config=<path to file>

Actual behavior

I have two app .toml files for dev and prod. I previously was swapping between them with shopify app config use and was able to deploy both apps separately just with shopify app deploy. Currently, shopify app dev and shopify app deploy seem "locked" to the dev version.

Both dev and deploy always use the api key from the dev version and overwrite .../shopify-cli-app-nodejs/config.json with the incorrect app id, even if I set it again with shopify app config use.

  • dev shows the warning (The flag api-keyhas been deprecated in favor ofclient-id), deploy` does not
  • explicitly setting --config does not work
  • explicitly setting --client-id does work
  • changing .env files did not work
  • clearing all shopify npm cache directories did not work

These commands work fine:

  • shopify app versions list
  • shopify app info

I'm assuming it's a local setup thing, but as far as I know, I didn't change anything except upgrading the cli, so others might run into this.

Verbose output

Sorry, I don't have time to redact the output right now! All I've got is:

  • FindApp runs with the wrong apiKey value.

Reproduction steps

I'll add exact steps later if I can but so far all I know is:

  • try to run shopify app deploy in a project with multiple deployed .toml configurations, switching between them with shopify app config use

Operating System

Mac 14.6 (23G80)

Shopify CLI version (shopify --version)

@shopify/cli/3.71.4 darwin-arm64 node-v20.16.0

Shell

zsh

Node version (run node -v if you're not sure)

20.16.0

What language and version are you using in your application?

node v20.16.0

@Goondrious Goondrious added the Type: Bug Something isn't working label Dec 7, 2024
@frandiox frandiox added the Area: @shopify/app @shopify/app package issues label Dec 10, 2024
@isaacroldan
Copy link
Contributor

Hi @Goondrious!

So this is likely because you have some api key defined in your ENV, this line is the hint:

The flag api-key has been deprecated in favor of client-id

Look for SHOPIFY_API_KEY in your terminal env (echo $SHOPIFY_API_KEY) or in any process that might be setting this value (SHOPIFY_API_KEY). This ENV value takes precedence over any other defined via config use.

Let me know if this works!

@Goondrious
Copy link
Author

With all the random testing I did, I somehow did not think of directly checking system ENV. I have no idea how it go there. Thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: @shopify/app @shopify/app package issues State: Waiting for feedback Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants