Shopify CLI 3, ERROR-Invalid_target but logged in successfully

Shopify CLI 3, ERROR-Invalid_target but logged in successfully

ibrvimv
Shopify Partner
4 0 7

I made integration of dawn theme with GitHub and it works fine, and I want to run it locally in my vscode. I used the command "shopify theme --store {panda-ibrvimv}.myshopify.com" and also tried "shopify theme --store {panda-ibrvimv}", then shopify theme dev which throws me to log in,  writes me  "You've successfully logged into the Shopify CLI! You can close this tab and return to your terminal."

then in the terminal again Error Invalid_target

please help me to figure it out, thanks

Replies 46 (46)

bcrave
Shopify Partner
4 0 8

I'm having the same problem

the_rbt
Shopify Partner
4 0 2

I'm facing the same problem too.

invalid_target

 

Ricardo31
Shopify Partner
1 0 1

I have the same problem, could you solve the problem?

Web-Wizard
Shopify Partner
15 4 11

Here is the solution, use 

shopify theme pull --store shopname.myshopify.com instead of 

shopify theme pull --store {shopname.myshopify.com}

please do not use curly braces {} Hope it helps

Kind regards,
Shahidul
Web Wizard
email: contact@webwizard.ie
raitiszee
Shopify Partner
1 0 0

Worked for me, thanks!

MullerMan
Shopify Partner
9 0 1

Yes, this worked for me. In my case I was trying

'shopify theme dev --store{store_name}, but instead I used

'shopify theme dev --store store_name.myshopify.com and it worked.

HAM3
Shopify Partner
3 0 1

I tried what you said but I have the same issue.

sasagichuki
Visitor
1 0 0

This worked, Thank you.

bcrave
Shopify Partner
4 0 8

So instead of using `shopify theme init`, I started over using `yarn create @Shopify/app` and that worked for me.

bcrave
Shopify Partner
4 0 8
  • npx @Shopify/create-app@latest (installed by default with Node)
  • pnpm create @Shopify/create-app@latest
  • yarn create @Shopify/app

Found this on the NPM documentation.  Perhaps Shopify should also update theirs...

the_rbt
Shopify Partner
4 0 2

Thanks but still did not work.

ibrvimv
Shopify Partner
4 0 7

I could've solved it just by reverting to CLI 2 version, and it worked

Freddie_Lawson
Shopify Partner
10 0 3

Would you mind telling me how you downgraded to CLI 2? Many thanks

ibrvimv
Shopify Partner
4 0 7

https://shopify.dev/apps/tools/cli/cli-2/install-upgrade

 

brew tap shopify/shopify
brew install shopify-cli@2

 

just need always type "shopify2" command instead "shopify"

Freddie_Lawson
Shopify Partner
10 0 3

Thanks! It was the "shopify2" which was causing me problems

 

Are you resigned to using CLI 2 for the foreseeable? I raised a ticket with Shopify on this but doubt it will get picked up

PixelBox
Shopify Partner
3 0 1

I am new to Shopify Development, but have experienced with Web Dev. Any idea when they will fix this? My preference is to use the CLI to practice good habits now and also syncing with Git is a plus.... 

CarmineT
Shopify Partner
87 2 26

In this way you simply created a new scalfold to create a new brand theme

KamilK
Shopify Partner
1 0 0

Same problem here 😕 i'm trying to use v2.0

Screen Shot 2022-11-27 at 19.51.36.png

ibrvimv
Shopify Partner
4 0 7

You need to type "

shopify2"

ArahmnaAd
Visitor
1 0 0

I don't get it where exactly do I type shopify2

 

Freddie_Lawson
Shopify Partner
10 0 3

Whenever you are using a CLI command - https://shopify.dev/themes/tools/cli
Instead of 'shopify', type 'shopify2'

bureau213
Tourist
3 0 2

I'm having the same issue. Has nobody found a solution?

MaxxWayne
Shopify Partner
1 0 6

Hello Guys ! 
I had the same issue for a moment but I just figured it out with the follwing command : 
shopify theme dev --store store-name instead of shopify theme dev --store {store-name}

Hope it'll be helpful 

Strength and Honor
peasquared
Shopify Partner
14 0 8

I wish it was that but I was already entering it the correct way. Logged in just fine in browser but Terminal shows error still no matter how many times I do it.

Shop_dev
Shopify Partner
1 0 0

worked for me, too. Thanks!

dpkreativ
Shopify Partner
1 0 0

This worked for me! Thank you.

D.O

Ben31
Trailblazer
202 8 149

The docs are confusing if you're a designer and the --store flag seems to be written different ways with respect to the store URL. Shopify needs to do better at catering to designers.

 

To fix, remove the {} from the command like this...

 

shopify theme pull --store https://yourstore.myshopify.com

 

 

NOT this (as written in some of the docs)...

 

shopify theme pull --store {yourstore.myshopify.com}

 

 

press223344
Visitor
1 0 0

wow! this should be up in the docs

bigmark_and_co
Shopify Partner
1 0 0

Thank you! This is the way 🙂 Solved my problem.

christoph-codes
Shopify Partner
1 0 1

Found the solution for this if anyone is still looking for it. The store url has to be the [storename].myshopify.com without brackets of course and it cannot be your website url.

 

shopify theme pull --store replaceWithYourStore.myshopify.com

 

Installing Shopify 2 works as well.

 

brew install shopify-cli@2

 

Let me know if this works for anyone!

luketomasik
Shopify Partner
1 0 4

Hello, was looking at this thread to try and find a solution but doesnt seem to be working for me. still getting invalid_target error. I get the auth screen but in the terminal it gives me an the error.
I can typ shopify theme info and it says under theme configuration the store and all the info is correct but i cannot serve up a dev server.

Going to revert back to the 2.0 version untill i hear back about a potential solution

shopify_cli issue.jpg


#EDIT 1
I have found the solution! for any1 else having problems with this when you do 'shopify theme dev or shopify theme pull --store' make sure you put EXACTLY what your admin url is not what your domain name is.
If you are used to cli 2.0 you used to do 'shopify theme pull --store myfirststore.com' HOWEVER if you login to your admin panel in shopify and the url is "admin.shopify.com/my-first-store.com' then you need to type 'shopify theme pull --store my-first-store.com'

TLDR -> login to shopify admin panel on the web and find out EXACTLY what your store name is in that url and that's what you need to put.

edvinicombe
Shopify Partner
2 0 0

Woo!! Worked

 

Thanks mate

 

adnanafsari
Shopify Partner
1 0 0

Everyone should try this solution before anything if you are facing this problem.

Vystii
Shopify Partner
2 0 0

That was it. I was using the subdomain instead of my store id. Thanks a lot

romantegeler
Shopify Partner
1 0 0

I had the same Invalid_target error when trying to connect with Safari on mac. After changing to Chrome, the login worked fine..

vishalmanavar92
Shopify Partner
1 0 4

Hello

Recently I was facing the same issue. But, I have resolved it.
- Make sure that you have installed the latest version of Bundler. I am having bundler-2.4.13.
- Run the theme pull command
shopify theme pull --store {storename}
Make sure that you store name is not equal to your store URL.
My admin store url is
https://admin.shopify.com/store/vishal-online/themes?appLoadId=35d1sadad3e-3asda3-4914-969c-c7e560b3...
So, storename = vishal-online

So, complete command would be shopify theme pull --store vishal-online.

If you face permission issue then please run above command with sudo.

Hope it will work.

Thanks
Vishal Manavar

yaya154
Visitor
1 0 0

Worked for me !! thank you 🙂

Artrillionaire
Shopify Partner
1 0 0

This worked for me too. For some reason, it wasn't using my store name. Instead, it was a random string of numbers and letters.

 

My admin store URL is something like:

https://admin.shopify.com/store/as94nb-4/themes

 

The store name in my case was: as94nb-4

 

The shopify command you'd run would be:

shopify theme pull --store as94nb-4

HAM3
Shopify Partner
3 0 1

Dude, you help me a lot thanks.

devGeriylli
Shopify Partner
1 0 1

I had the same problem and after some research I found out that when using the command: shopify theme dev --store name-store.myshopify.com you need to make sure that the url is correct. In 2 of my stores, we had changed the domain name for redirection purpose. So to find the correct url of your store you need to go Settings > Domains. From there you can see what the correct url is. Hope this helps!

yuwen
Shopify Partner
8 1 0

I first used the default domain name but it didn't work, then I saw this post, so I tried other domain name and the one end with ".myshopify.com" really worked! Thanks!!

CodeEx
Shopify Partner
1 0 0

Facing the same error using CLI version 3.47.5

dhatguy
Shopify Partner
1 0 0

https://admin.shopify.com/store/storename189

 

shopify theme pull --store storename189

That's what worked for me

CarmineT
Shopify Partner
87 2 26

get the password to access the store theme as developer:

 

Let the merchant install the app theme access that based on your email will sent you an email with a password

 

This is the command to have a the list of theme inside your store

 

theme get --list --password=[your password] --store=yourshopname.myshopify.com

 

You should get a list of the theme associate with that store

 

then run this will download the theme selected

 

     theme get --password=[your-password] --store="[your-store.myshopify.com]" --themeid=[your-theme-id]

 

ashawesomeone
Shopify Partner
1 0 0

Use --store yourstore.myshopify.com 

without curly braces

HG7
Shopify Partner
1 0 0

I had exactly this problem as well. To solve I used this format to access my store 

 

shopify theme dev --store (insert whatever your store name is- no parenthesis ).myshopify.com

 

It still wasn't working after that so I checked the store itself and found out that I was using a free trial version of shopify instead of my partner acc. Im guessing if you dont have a paid plan or a partner account shopify thinks your a staff member instead of the store owner. 

 

Hope this helped