Solved

Problem with Shopify CLI

ehsan1
Tourist
3 0 3

I installed the latest versions of Ruby, Git, and Shopify CLI but  when I use the command "Shopify theme serve" I got this error and also same for the command "Shopify theme pull".


"X An unexpected error occurred.
To submit an issue include the stack trace.

? Send an anonymized error report to Shopify? (Navigate up with 'k' and down with 'j', press Enter to select, filter with
'f')
> 1. Yes, send
2. No, don't send"

And I already added SHOPIFY_CLI_STACKTRACE=1 in the environmental variables.

I tried different solutions to solve this error but am not able to solve it so please kindly help me with this.

Screenshot of the error is also attached.

Shopify version: 2.15.1
Ruby version: 3.3.7

Git version: 2.35.1

 

Screenshot (477).png


 

Accepted Solution (1)

AlexWzorek
Shopify Partner
2 1 2

This is an accepted solution.

Update: 

 

Found a solution.

 

  1. Log out of your shopify account in the browser
  2. Log out through shopify CLI (if not already logged out) "shopify logout"
  3. Log in to {shop}.myshopify.com/admin in the browser
  4. Then log in through shopify CLI "shopify login --store {shop}.myshopify.com"

You should be able to run "shopify theme serve" after this. If not, make sure you log out of anywhere you're logged in to shopify and try again.

View solution in original post

Replies 6 (6)

AlexWzorek
Shopify Partner
2 1 2

I also followed the setup guide, however, Im getting the same error when I use "shopify theme serve". I was able to pull but unable to run the server. 

AlexWzorek
Shopify Partner
2 1 2

This is an accepted solution.

Update: 

 

Found a solution.

 

  1. Log out of your shopify account in the browser
  2. Log out through shopify CLI (if not already logged out) "shopify logout"
  3. Log in to {shop}.myshopify.com/admin in the browser
  4. Then log in through shopify CLI "shopify login --store {shop}.myshopify.com"

You should be able to run "shopify theme serve" after this. If not, make sure you log out of anywhere you're logged in to shopify and try again.

ehsan1
Tourist
3 0 3

I followed all of your steps but the same error is still there 😞

ehsan1
Tourist
3 0 3

I tried your solution again with a different partner account and it worked for me. 
Thanks a lot! i almost wasted 2 days to solve this issue.
Thanks again! really appreciate your help!

atila
Shopify Partner
5 0 2

I stumbled on this issue today and spent hours and hours to track it down and get solved.

Initially, I downgraded my ruby version to 3.0.0 and upgraded node to above 14 version.

The problem persisted and I ran the command 

 

shopify theme pull shopify-mystore

 

adding the theme name after the command just as it appears when I ran 

 

shopify theme list

 

Finally it went through but not before displaying me the list of themes on my store and asking me to confirm by the number of it. This time the pull went through and I found myself in another problem on the  

 

shopify theme serve

 

But that's an issue for another chapter.

cgtysnsy
Shopify Partner
1 0 0

I also faced the same error, but I realized that I had placed my files in the wrong directory. Once I corrected the directory, the error was resolved.