Main issue: Shopify CLI returns ‘invalid_target’ after successful login when running theme commands (e.g., shopify theme dev / shopify theme pull) with the --store flag.
Key context:
Some noticed the issue after upgrading CLI 3.22.1 → 3.23.0, but no clear version-specific cause.
Screenshots show the auth flow completing, then the error. Images are illustrative but not required to follow the fix.
Root causes discussed:
Incorrect --store value (using display name, braces {}, or a changed domain).
Confusing docs that mix formats for the --store flag.
In some cases, no store existed on the account.
Working solutions (multiple confirmations):
Use the original myshopify subdomain (the “store name” in the admin URL), e.g.: shopify theme dev --store b5d80a-2.
Or provide the full myshopify domain without braces: shopify theme pull --store https://yourstore.myshopify.com.
Do not include {} around the store value.
If you don’t have a store, create one first, then retry.
Status: Largely resolved for many after targeting the correct original myshopify subdomain or proper URL format; a few earlier reports remained unresolved prior to these fixes.
I am just learning how the Shopify CLI works and am just following the docs right now. Whenever I run shopify theme dev --store {my-store}, I am able to log in successfully but then get an error saying invalid_target.
I can’t find any info on this error in the documentation, and have tried the login process on both Firefox and Chrome browsers. Has anyone been able to resolve this issue successfully?
The docs are confusing if you’re a designer and the --store flag seems to be written different ways depending on the page with respect to the store URL. Shopify needs to do better at catering to us lowly designers!
Is there any update on this thread? I’ve been trying to fix this all morning but not had any luck yet. Still getting an ‘invalid_target’ error when trying to develop my theme
After spending hours to find the solution here is what you would need to type in the terminal to login and serve the theme. You will have to login first to your theme and know the store name. In below image I have pointed to the URL for the store name. You will get this URL after logging into the store.
This was driving me crazy, the store had been renamed so it was the original name that I needed all along to pull the theme file — before this, I was stumbling down many rabbit holes, so Kudos to you
Thank you, this worked for me as well. First time this has happened to me, I guess it occurs when the store changes its name or something like that. Anyway, it’s all sorted now. Thanks again!