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 CLI - npm run dev -- -- --reset hangs on app-select/app name step unless Enter is pressed #3091

Closed
2 tasks done
Nix-C opened this issue Nov 10, 2023 · 5 comments
Assignees
Labels
no-issue-activity Type: Bug Something isn't working

Comments

@Nix-C
Copy link

Nix-C commented Nov 10, 2023

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?

Other

Expected behavior

  1. Run npm run dev -- -- --reset

  2. Choose either y (Create new app) or n (Select pre-existing app).

  3. Use keyboard inputs to name/re-name or select a pre-existing app from the list.

Actual behavior

When running npm run dev -- -- --reset, choosing either (y) Yes, create it as a new app or (n) No, connect it to an existing app results in Shopify CLI UI being unresponsive, dumping all inputs into a buffer line at the bottom of the terminal. Ctrl+C has no effect.

Pressing enter submits content of buffer, but often results in the user being re-prompted. While this does make the CLI usable again, I believe this should still be addressed as you cannot re-name the app.

This seems to only occurr if there is an existing shopify.app.toml or shopify.app.[app-name].toml configuration file present in the project.

Verbose output

PS E:\Work\Shopify Apps\shopify-helper-app> npm run dev -- -- --reset --verbose
Debugger listening on ws://127.0.0.1:25466/341a85df-80a2-4233-ade5-6858237e8696
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> scp-checkouts@1.0.0 dev
> shopify app dev --reset --verbose

Debugger listening on ws://127.0.0.1:25469/9d5db51e-9d97-499b-99aa-fbbabcce8705
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
2023-11-10T19:02:25.622Z: Running command app dev
2023-11-10T19:02:25.633Z: Getting a random port...
2023-11-10T19:02:25.643Z: Random port obtained: 25473
2023-11-10T19:02:25.664Z: 
Running system process:
  · Command: E:/Work/Shopify Apps/shopify-helper-app/node_modules/@shopify/plugin-cloudflare/bin/cloudflared.exe tunnel --url http://localhost:25473 --no-autoupdate        
  · Working directory: E:/Work/Shopify Apps/shopify-helper-app

2023-11-10T19:02:25.668Z: Ensuring that the user is authenticated with the Partners API with the following scopes:
[]

2023-11-10T19:02:25.669Z: Getting session store...
2023-11-10T19:02:25.673Z: Validating existing session against the scopes:
[
  "openid",
  "https://api.shopify.com/auth/shop.admin.graphql",
  "https://api.shopify.com/auth/shop.admin.themes",
  "https://api.shopify.com/auth/partners.collaborator-relationships.readonly",        
  "https://api.shopify.com/auth/shop.storefront-renderer.devtools",
  "https://api.shopify.com/auth/partners.app.cli.access",
  "https://api.shopify.com/auth/destinations.readonly"
]
For applications:
{
  "partnersApi": {
    "scopes": []
  }
}

2023-11-10T19:02:25.676Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2023-11-10T19:02:25.677Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
 - User-Agent: Shopify CLI; v=3.50.2
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: win32
 - Content-Type: application/json

2023-11-10T19:02:25.691Z: 2023-11-10T19:02:25Z INF Thank you for trying Cloudflare Tunnel. Doing so, without a Cloudflare account, is a quick way to experiment and try it out. However, be aware that these account-less Tunnels have no uptime guarantee. If you intend to use Tunnels in production you should use a pre-created named tunnel by following: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps      

2023-11-10T19:02:25.693Z: 2023-11-10T19:02:25Z INF Requesting new quick Tunnel on trycloudflare.com...

2023-11-10T19:02:25.897Z: Request to https://accounts.shopify.com/oauth/introspection 
completed in 212 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"ab92fd23a7e588db781a5838f62ea615"
 - x-request-id: 100070a1-8f23-4713-9355-009b7a5d9305
    
2023-11-10T19:02:25.901Z: The identity token is valid: true
2023-11-10T19:02:25.901Z:
The validation of the token for application/identity completed with the following results:
- It's expired: false
- It's invalid in identity: false
  
2023-11-10T19:02:25.902Z: Verifying that the user has a Partner organization
2023-11-10T19:02:25.937Z: Sending "Partners" GraphQL request:
  {
    organizations(first: 1) {
      nodes {
        id
      }
    }
  }

With request headers:
 - User-Agent: Shopify CLI; v=3.50.2
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: win32
 - Content-Type: application/json

2023-11-10T19:02:26.173Z: Request to https://partners.shopify.com/api/cli/graphql completed in 220 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"d1c26612b12f0594c0ff397b199bcaca"
 - x-request-id: 9c428d9c-bd7d-44fa-b9a1-15616e3ac7a4
    
2023-11-10T19:02:26.186Z: Reading cached app information for directory E:/Work/Shopify Apps/shopify-helper-app...
2023-11-10T19:02:26.187Z: Clearing app information for directory E:/Work/Shopify Apps/shopify-helper-app...
2023-11-10T19:02:26.329Z: Reading cached app information for directory E:/Work/Shopify Apps/shopify-helper-app...
2023-11-10T19:02:26.331Z: Reading the content of file at shopify.app.toml...
2023-11-10T19:02:26.334Z: Reading the content of file at shopify.app.toml...
2023-11-10T19:02:26.338Z: Reading the content of file at shopify.app.helper-app-nathan-dev.toml...
2023-11-10T19:02:26.338Z: Reading the content of file at shopify.app.scp-helpers-dev.toml...
2023-11-10T19:02:26.339Z: Reading the content of file at shopify.app.staging-admin-tools.toml...
2023-11-10T19:02:26.339Z: Reading the content of file at shopify.app.toml...
2023-11-10T19:02:26.447Z: Reading the .env file at .env
2023-11-10T19:02:26.447Z: Reading the content of file at .env...
2023-11-10T19:02:26.452Z: Reading the content of file at extensions/checkout-message/shopify.ui.extension.toml...
2023-11-10T19:02:26.452Z: Reading the content of file at extensions/checkout-upsell/shopify.extension.toml...
2023-11-10T19:02:26.452Z: Reading the content of file at extensions/dangerous-goods-rules/shopify.extension.toml...
2023-11-10T19:02:26.453Z: Reading the content of file at extensions/hide-media-mail/shopify.function.extension.toml...
2023-11-10T19:02:26.453Z: Reading the content of file at extensions/pdp-preorder/shopify.theme.extension.toml...
2023-11-10T19:02:26.454Z: Reading the content of file at extensions/preorder-ship-date/shopify.ui.extension.toml...
2023-11-10T19:02:26.454Z: Reading the content of file at extensions/quantity-limit/shopify.function.extension.toml...
2023-11-10T19:02:26.460Z: Reading the content of file at extensions/checkout-upsell/shopify.extension.toml...
2023-11-10T19:02:26.463Z: Reading the content of file at package.json...
2023-11-10T19:02:26.464Z: Reading the content of file at package.json...
2023-11-10T19:02:26.464Z: Obtaining the dependency manager in directory E:/Work/Shopify Apps/shopify-helper-app...
2023-11-10T19:02:26.473Z: Reading the content of file at web/shopify.web.toml...      
2023-11-10T19:02:26.474Z: Reading the content of file at web/frontend/shopify.web.toml...
2023-11-10T19:02:26.547Z: Reading the content of file at package.json...
2023-11-10T19:02:26.549Z: Ensuring that the user is authenticated with the Partners API with the following scopes:
[]

2023-11-10T19:02:26.550Z: Getting session store...
2023-11-10T19:02:26.551Z: Validating existing session against the scopes:
[
  "openid",
  "https://api.shopify.com/auth/shop.admin.graphql",
  "https://api.shopify.com/auth/shop.admin.themes",
  "https://api.shopify.com/auth/partners.collaborator-relationships.readonly",        
  "https://api.shopify.com/auth/shop.storefront-renderer.devtools",
  "https://api.shopify.com/auth/partners.app.cli.access",
  "https://api.shopify.com/auth/destinations.readonly"
]
For applications:
{
  "partnersApi": {
    "scopes": []
  }
}

2023-11-10T19:02:26.552Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2023-11-10T19:02:26.553Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
 - User-Agent: Shopify CLI; v=3.50.2
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: win32
 - Content-Type: application/json

2023-11-10T19:02:26.742Z: Request to https://accounts.shopify.com/oauth/introspection 
completed in 188 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"ab92fd23a7e588db781a5838f62ea615"
 - x-request-id: dd8147a6-0af9-4149-8ca6-96e8f27abc5d
    
2023-11-10T19:02:26.744Z: The identity token is valid: true
2023-11-10T19:02:26.745Z:
The validation of the token for application/identity completed with the following results:
- It's expired: false
- It's invalid in identity: false
  
2023-11-10T19:02:26.745Z: Verifying that the user has a Partner organization
2023-11-10T19:02:26.785Z: Sending "Partners" GraphQL request:
  {
    organizations(first: 1) {
      nodes {
        id
      }
    }
  }

With request headers:
 - User-Agent: Shopify CLI; v=3.50.2
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: win32
 - Content-Type: application/json

2023-11-10T19:02:26.877Z: 2023-11-10T19:02:26Z INF +--------------------------------------------------------------------------------------------+
2023-11-10T19:02:26Z INF |  Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):  |
2023-11-10T19:02:26Z INF |  https://spiritual-lyrics-msie-surprise.trycloudflare.com  
                                |

2023-11-10T19:02:26.878Z: 2023-11-10T19:02:26Z INF +--------------------------------------------------------------------------------------------+
2023-11-10T19:02:26Z INF Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp]
2023-11-10T19:02:26Z INF Version 2023.5.1
2023-11-10T19:02:26Z INF GOOS: windows, GOVersion: go1.19, GoArch: amd64
2023-11-10T19:02:26Z INF Settings: map[ha-connections:1 no-autoupdate:true protocol:quic url:http://localhost:25473]
2023-11-10T19:02:26Z INF cloudflared will not automatically update on Windows systems.2023-11-10T19:02:26Z INF Generated Connector ID: 4b99234e-98a5-4f8b-bee5-eba37739996f 

2023-11-10T19:02:26.879Z: 2023-11-10T19:02:26Z INF Initial protocol quic

2023-11-10T19:02:26.880Z: 2023-11-10T19:02:26Z INF ICMP proxy will use 10.0.0.188 as source for IPv4

2023-11-10T19:02:26.885Z: 2023-11-10T19:02:26Z INF ICMP proxy will use 2601:249:300:3620::44f8 in zone Ethernet 2 as source for IPv6

2023-11-10T19:02:26.892Z: 2023-11-10T19:02:26Z INF cloudflared does not support loading the system root certificate pool on Windows. Please use --origin-ca-pool <PATH> to specify the path to the certificate pool

2023-11-10T19:02:26.893Z: 2023-11-10T19:02:26Z INF Starting metrics server on 127.0.0.1:25480/metrics

2023-11-10T19:02:27.011Z: Request to https://partners.shopify.com/api/cli/graphql completed in 222 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"d1c26612b12f0594c0ff397b199bcaca"
 - x-request-id: eaa1fd12-f441-4cb6-bf53-6e8ae58466ba
    
2023-11-10T19:02:27.062Z: Sending "Partners" GraphQL request:
  {
    organizations(first: 200) {
      nodes {
        id
        businessName
        website
      }
    }
  }

With request headers:
 - User-Agent: Shopify CLI; v=3.50.2
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: win32
 - Content-Type: application/json

2023-11-10T19:02:27.161Z: 2023-11-10T19:02:27Z WRN Your version 2023.5.1 is outdated. 
We recommend upgrading it to 2023.10.0

2023-11-10T19:02:27.243Z: 2023-11-10T19:02:27Z INF Registered tunnel connection connIndex=0 connection=caf84b33-7825-4dcc-a428-558975e3ee47 event=0 ip=198.41.192.107 location=ewr13 protocol=quic

2023-11-10T19:02:27.285Z: Request to https://partners.shopify.com/api/cli/graphql completed in 220 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"e3fd6cf4eb1c8216b9c4b0ea7cd75573"
 - x-request-id: 82b2fe44-a62f-490f-bfaf-0b955e53a353
    
2023-11-10T19:02:27.358Z: Sending "Partners" GraphQL request:
  query FindOrganization($id: ID!, $title: String) {
    organizations(id: $id, first: 1) {
      nodes {
        id
        businessName
        website
        apps(first: 25, title: $title) {
          pageInfo {
            hasNextPage
          }
          nodes {
            id
            title
            apiKey
          }
        }
      }
    }
  }

With variables:
{
  "id": "1739810"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.50.2
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: win32
 - Content-Type: application/json

2023-11-10T19:02:27.597Z: Request to https://partners.shopify.com/api/cli/graphql completed in 235 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"594f38897aac2be30ef269ad8d43b4e9"
 - x-request-id: 24c2bb6c-d946-4af5-9ac2-fbf09070e951
    
2023-11-10T19:02:27.649Z: Sending "Partners" GraphQL request:
  query FindOrganization($id: ID!) {
    organizations(id: $id, first: 1) {
      nodes {
        id
        stores(first: 500, archived: false, type: [DEVELOPMENT, PLUS_SANDBOX]) {      
          nodes {
            shopId
            link
            shopDomain
            shopName
            transferDisabled
            convertableToPartnerTest
          }
        }
      }
    }
  }

With variables:
{
  "id": "1739810"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.50.2
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: win32
?  Which existing app is this for?   Type to search...

>  scp-checkouts
   scp-checkouts
   scp-checkouts
   Staging Admin Tools (shopify.app.staging-admin-tools.toml)
?  Which existing app is this for?   Type to search...

>  scp-checkouts                                                                      
   scp-checkouts                                                                      
   scp-checkouts                                                                      
   Staging Admin Tools (shopify.app.staging-admin-tools.toml)                         
   test-app-102                                                                       
   justin-helper-dev-1030                                                             
   scp-helpers-dev-nathaniel                                                          
   justin-dev-helper-10-30                                                            
   SCP Size Charts                                                                    
   mitski-free-shipping-function                                                      
   SCP Tokengating                                                                    
   helper-app-2-nathaniel                                                             
   tokengating-example-app                                                            
   scp-tokengating-dev                                                                
   George-lineitems-webhook-app                                                       
   Custom App distro test                                                             
   kevins-checkout-ext-dev                                                            
   kevins-dev-helper                                                                  
   kevins-dev-helper                                                                  

   Press ↑↓ arrows to select, enter to confirm.
   1-25 of many  Find what you're looking for by typing its name.
nathaniel ^C^C^C^C

Reproduction steps

  1. Have a pre-existing .toml configuration for the app. (Run npm run dev as normal).
  2. Run npm run dev -- -- --reset
  3. Select either y or n
  4. Try typing
  5. If no luck, press enter and be re-promted. However, this will fail when trying to name the app with option y, and you will not be able to re-name it.

Operating System

Windows 10

Shopify CLI version (check your project's package.json if you're not sure)

3.50.0

Shell

pwsh

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

v18.15.0

What language and version are you using in your application?

Node v18.15.0, TS

@Nix-C Nix-C added the Type: Bug Something isn't working label Nov 10, 2023
@amcaplan
Copy link
Contributor

Thanks for the submission @Nix-C! I've managed to repro, but this only happens in Windows and it may take some time to figure out why.

@amcaplan amcaplan self-assigned this Nov 22, 2023
Copy link
Contributor

github-actions bot commented Jan 4, 2024

This issue 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.

P.S. You can learn more about why we stale issues here.

@amcaplan
Copy link
Contributor

amcaplan commented Jan 4, 2024

still relevant

@aurelienbobenrieth
Copy link

aurelienbobenrieth commented Feb 5, 2024

Exactly the same error on my end.
Windows 11.
"@shopify/cli": "^3.55.3"

Even with no shopify.app.toml file.

Though, if you press "Enter" once you then can select the desired configuration.

Copy link
Contributor

This issue 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.

P.S. You can learn more about why we stale issues here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-issue-activity Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants