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 dev fails to find available port for GraphiQL #4927

Open
2 tasks done
sambostock opened this issue Nov 26, 2024 · 4 comments
Open
2 tasks done

[Bug]: shopify app dev fails to find available port for GraphiQL #4927

sambostock opened this issue Nov 26, 2024 · 4 comments
Labels
Area: @shopify/app @shopify/app package issues State: Waiting for feedback Type: Bug Something isn't working

Comments

@sambostock
Copy link

sambostock commented Nov 26, 2024

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

Running shopify app dev to start servers for multiple apps at the same time should work.

Actual behavior

Running shopify app dev works for the first app works,

% shopify app dev
...
GraphiQL URL: http://localhost:3457/graphiql
...

but for the second app blows up with

% shopify app dev
...
GraphiQL URL: http://localhost:3457/graphiql

Error: listen EADDRINUSE: address already in use :::3457
...

Verbose output

Output
(3.11.8) sambostock@127 app-name Ƨ npm run shopify app dev -- --verbose

> shopify
> shopify app dev --verbose

2024-11-26T19:54:33.373Z: Running command app dev
2024-11-26T19:54:33.378Z: Notifications to show: 0
╭─ warning ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                      │
│  The flag `api-key` has been deprecated in favor of `client-id`                                                                                                                                      │
│                                                                                                                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

2024-11-26T19:54:33.409Z: Reading cached app information for directory /Users/sambostock/src/github.com/Shopify/app-name...
2024-11-26T19:54:33.409Z: Reading the content of file at shopify.app.toml...
2024-11-26T19:54:33.411Z: Reading the content of file at shopify.app.toml...
2024-11-26T19:54:33.413Z: Ensuring that the user is authenticated with the Partners API with the following scopes:
[]

2024-11-26T19:54:33.413Z: Getting session store...
2024-11-26T19:54:33.414Z: 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": []
  }
}

2024-11-26T19:54:33.414Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2024-11-26T19:54:33.416Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

2024-11-26T19:54:33.828Z: Request to https://accounts.shopify.com/oauth/introspection completed in 412 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/"c02af8cdfb760900b94469c6553aa03a"
 - server-timing: processing;dur=28, socket_queue;dur=1.433, edge;dur=1.017, util;dur=0.05, cfRequestDuration;dur=95.000029, shopifolk; desc=employee
 - x-request-id: c99fa218-1b9f-44cb-9042-1250bc746365-1732650873
    
2024-11-26T19:54:33.832Z: The identity token is valid: true
2024-11-26T19:54:33.832Z: 
The validation of the token for application/identity completed with the following results:
- It's expired: false
- It's invalid in identity: false
  
2024-11-26T19:54:33.833Z: Verifying that the user has a Partner organization
2024-11-26T19:54:33.834Z: Confirmed partner account exists from cache
2024-11-26T19:54:33.835Z: Getting partner account info from cache
2024-11-26T19:54:33.841Z: Sending "Partners" GraphQL request:
  query FindApp($apiKey: String!) {
    app(apiKey: $apiKey) {
      id
      title
      apiKey
      organizationId
      apiSecretKeys {
        secret
      }
      appType
      grantedScopes
      applicationUrl
      redirectUrlWhitelist
      requestedAccessScopes
      webhookApiVersion
      embedded
      posEmbedded
      preferencesUrl
      gdprWebhooks {
        customerDeletionUrl
        customerDataRequestUrl
        shopDeletionUrl
      }
      appProxy {
        subPath
        subPathPrefix
        url
      }
      developmentStorePreviewEnabled
      disabledFlags
    }
  }

With variables:
{
  "apiKey": "*****"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

to https://partners.shopify.com/api/cli/graphql
2024-11-26T19:54:35.863Z: Request to https://partners.shopify.com/api/cli/graphql completed in 2020 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"27a8e1398c7a5a9a1e7502ef20de39d0"
 - server-timing: processing;dur=600, socket_queue;dur=139.426, util;dur=1.0, cfRequestDuration;dur=824.000120, shopifolk; desc=employee
 - x-request-id: 17de0668-61dd-41e2-ac0c-37d09830e7f6-1732650873
    
2024-11-26T19:54:35.924Z: Sending "Partners" GraphQL request:
  query FindOrganization($id: ID!) {
    organizations(id: $id, first: 1) {
      nodes {
        id
        businessName
      }
    }
  }

With variables:
{
  "id": "9082"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

to https://partners.shopify.com/api/cli/graphql
2024-11-26T19:54:36.264Z: Request to https://partners.shopify.com/api/cli/graphql completed in 339 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"abd9b5931ef587ee5907bf2fa9743c9e"
 - server-timing: processing;dur=85, socket_queue;dur=32.65, util;dur=0.8, cfRequestDuration;dur=180.999994, shopifolk; desc=employee
 - x-request-id: 8e1d2956-2400-4f00-8b81-9919a793842b-1732650876
    
2024-11-26T19:54:36.277Z: Sending "Partners" GraphQL request:
  query fetchSpecifications($api_key: String!) {
    extensionSpecifications(apiKey: $api_key) {
      name
      externalName
      externalIdentifier
      identifier
      gated
      experience
      options {
        managementExperience
        registrationLimit
      }
      features {
        argo {
          surface
        }
      }
      validationSchema {
        jsonSchema
      }
    }
  }

With variables:
{
  "api_key": "c0274a85899009e388491e7eaf4b6b40"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

to https://partners.shopify.com/api/cli/graphql
2024-11-26T19:54:36.607Z: Request to https://partners.shopify.com/api/cli/graphql completed in 325 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"4352dd0fc9a1d711c4837b527f78efac"
 - server-timing: processing;dur=133, socket_queue;dur=7.276, util;dur=0.8, cfRequestDuration;dur=201.999903, shopifolk; desc=employee
 - x-request-id: 6889ebf1-f939-40f3-ad5d-5e651fc34d3b-1732650876
    
2024-11-26T19:54:36.676Z: Reading the .env file at .env
2024-11-26T19:54:36.677Z: Reading the content of file at .env...
2024-11-26T19:54:36.683Z: Reading the content of file at package.json...
2024-11-26T19:54:36.684Z: Reading the content of file at package.json...
2024-11-26T19:54:36.691Z: 
Running system process:
  · Command: npm prefix
  · Working directory: /Users/sambostock/src/github.com/Shopify/app-name

2024-11-26T19:54:37.051Z: Obtaining the dependency manager in directory /Users/sambostock/src/github.com/Shopify/app-name...
2024-11-26T19:54:37.054Z: 
Running system process:
  · Command: npm list @shopify/cli
  · Working directory: /Users/sambostock/src/github.com/Shopify/app-name

2024-11-26T19:54:38.482Z: 
Running system process:
  · Command: shopify version
  · Working directory: /Users/sambostock/src/github.com/Shopify/app-name

╭─ info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                      │
│  Two Shopify CLI installations found – using local dependency                                                                                                                                        │
│                                                                                                                                                                                                      │
│  A global installation (v3.70.0) and a local dependency (v3.70.0) were detected.                                                                                                                     │
│  We recommend removing the @shopify/cli and @shopify/app dependencies from your package.json, unless you want to use different versions across multiple apps.                                        │
│                                                                                                                                                                                                      │
│  See Shopify CLI documentation. [1]                                                                                                                                                                  │
│                                                                                                                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
[1] https://shopify.dev/docs/apps/build/cli-for-apps#switch-to-a-global-executable-or-local-dependency

2024-11-26T19:54:40.170Z: Reading the content of file at shopify.web.toml...
2024-11-26T19:54:40.172Z: Reading the content of file at package.json...
2024-11-26T19:54:40.172Z: Notifications to show: 0
2024-11-26T19:54:40.174Z: Reading cached app information for directory /Users/sambostock/src/github.com/Shopify/app-name...
2024-11-26T19:54:40.174Z: Storing app information for directory /Users/sambostock/src/github.com/Shopify/app-name:{
  "appId": "c0274a85899009e388491e7eaf4b6b40",
  "title": "sambostock-import-test",
  "directory": "/Users/sambostock/src/github.com/Shopify/app-name",
  "orgId": "9082"
}
2024-11-26T19:54:40.184Z: Sending "Partners" GraphQL request:
  query FindOrganization($orgId: ID!, $shopDomain: String) {
    organizations(id: $orgId, first: 1) {
      nodes {
        id
        businessName
        stores(shopDomain: $shopDomain, first: 1, archived: false) {
          nodes {
            shopId
            link
            shopDomain
            shopName
            transferDisabled
            convertableToPartnerTest
          }
        }
      }
    }
  }

With variables:
{
  "orgId": "9082",
  "shopDomain": "sambostock-import-test-shop.myshopify.com"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

to https://partners.shopify.com/api/cli/graphql
2024-11-26T19:54:40.736Z: Request to https://partners.shopify.com/api/cli/graphql completed in 551 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"c741f7cc1f4de994a318d809466d0d00"
 - server-timing: processing;dur=139, socket_queue;dur=2.216, util;dur=0.4, cfRequestDuration;dur=305.000067, shopifolk; desc=employee
 - x-request-id: 93fef22d-af1a-4021-9848-63e628c020e8-1732650880
    
2024-11-26T19:54:40.738Z: Getting a random port...
2024-11-26T19:54:40.740Z: Random port obtained: 51698
2024-11-26T19:54:40.780Z: cloudflared already installed, skipping
2024-11-26T19:54:40.782Z: 
Running system process:
  · Command: /Users/sambostock/src/github.com/Shopify/app-name/node_modules/@shopify/cli/bin/cloudflared tunnel --url http://localhost:51698 --no-autoupdate
  · Working directory: /Users/sambostock/src/github.com/Shopify/app-name

2024-11-26T19:54:40.787Z: Sending "Partners" GraphQL request:
  query activeAppVersion($apiKey: String!) {
    app(apiKey: $apiKey) {
      activeAppVersion {
        appModuleVersions {
          registrationId
          registrationUuid
          registrationTitle
          type
          config
          specification {
            identifier
            name
            experience
            options {
              managementExperience
            }
          }
        }
      }
    }
  }

With variables:
{
  "apiKey": "*****"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

to https://partners.shopify.com/api/cli/graphql
2024-11-26T19:54:40.805Z: 2024-11-26T19:54:40Z 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
2024-11-26T19:54:40Z INF Requesting new quick Tunnel on trycloudflare.com...

2024-11-26T19:54:41.250Z: Request to https://partners.shopify.com/api/cli/graphql completed in 463 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"77be898232cb7059c3eeb56ba5d0231e"
 - server-timing: processing;dur=326, socket_queue;dur=7.966, util;dur=1.3, cfRequestDuration;dur=416.999817, shopifolk; desc=employee
 - x-request-id: 100f995b-b575-40b4-b6c0-2bfa734342aa-1732650880
    
2024-11-26T19:54:41.253Z: Reading cached app information for directory /Users/sambostock/src/github.com/Shopify/app-name...
╭─ info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                      │
│  Using shopify.app.toml for default values:                                                                                                                                                          │
│                                                                                                                                                                                                      │
│    • Org:             Shopify                                                                                                                                                                        │
│    • App:             sambostock-import-test                                                                                                                                                         │
│    • Dev store:       sambostock-import-test-shop.myshopify.com                                                                                                                                      │
│    • Update URLs:     Yes                                                                                                                                                                            │
│                                                                                                                                                                                                      │
│   You can pass  `--reset`  to your command to reset your app configuration.                                                                                                                          │
│                                                                                                                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

2024-11-26T19:54:41.270Z: Port 3457 is free
2024-11-26T19:54:41.271Z: Polling tunnel status for cloudflare (attempt 0): starting
2024-11-26T19:54:41.271Z: Getting a random port...
2024-11-26T19:54:41.273Z: Random port obtained: 51712
2024-11-26T19:54:41.773Z: Polling tunnel status for cloudflare (attempt 1): starting
2024-11-26T19:54:42.276Z: Polling tunnel status for cloudflare (attempt 2): starting
2024-11-26T19:54:42.777Z: Polling tunnel status for cloudflare (attempt 3): starting
2024-11-26T19:54:43.279Z: Polling tunnel status for cloudflare (attempt 4): starting
2024-11-26T19:54:43.780Z: Polling tunnel status for cloudflare (attempt 5): starting
2024-11-26T19:54:44.236Z: 2024-11-26T19:54:44Z INF +--------------------------------------------------------------------------------------------+
2024-11-26T19:54:44Z INF |  Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):  |

2024-11-26T19:54:44.237Z: 2024-11-26T19:54:44Z INF |  https://internship-spending-zones-goto.trycloudflare.com                                  |
2024-11-26T19:54:44Z INF +--------------------------------------------------------------------------------------------+
2024-11-26T19:54:44Z INF Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]

2024-11-26T19:54:44.238Z: 2024-11-26T19:54:44Z INF Version 2024.8.2
2024-11-26T19:54:44Z INF GOOS: darwin, GOVersion: go1.22.2-devel-cf, GoArch: arm64
2024-11-26T19:54:44Z INF Settings: map[ha-connections:1 no-autoupdate:true protocol:quic url:http://localhost:51698]

2024-11-26T19:54:44.239Z: 2024-11-26T19:54:44Z INF Generated Connector ID: 52eb2b3a-67c0-416e-bbe9-22189f0bfb63

2024-11-26T19:54:44.281Z: Polling tunnel status for cloudflare (attempt 6): starting
2024-11-26T19:54:44.329Z: 2024-11-26T19:54:44Z INF Initial protocol quic

2024-11-26T19:54:44.330Z: 2024-11-26T19:54:44Z INF ICMP proxy will use 192.168.2.165 as source for IPv4

2024-11-26T19:54:44.330Z: 2024-11-26T19:54:44Z INF ICMP proxy will use fe80::18a6:73e9:aeb2:4542 in zone en0 as source for IPv6

2024-11-26T19:54:44.330Z: 2024-11-26T19:54:44Z INF Created ICMP proxy listening on 192.168.2.165:0

2024-11-26T19:54:44.331Z: 2024-11-26T19:54:44Z INF Created ICMP proxy listening on [fe80::18a6:73e9:aeb2:4542%en0]:0

2024-11-26T19:54:44.337Z: 2024-11-26T19:54:44Z ERR update check failed error="no release found"

2024-11-26T19:54:44.344Z: 2024-11-26T19:54:44Z INF Starting metrics server on 127.0.0.1:51734/metrics

2024-11-26T19:54:44.497Z: 2024-11-26T19:54:44Z INF Registered tunnel connection connIndex=0 connection=ec610465-e9f9-4aac-92b9-1439146a6922 event=0 ip=198.41.192.107 location=yul01 protocol=quic

2024-11-26T19:54:44.783Z: Polling tunnel status for cloudflare (attempt 7): connected
2024-11-26T19:54:44.785Z: Reading cached app information for directory /Users/sambostock/src/github.com/Shopify/app-name...
2024-11-26T19:54:44.794Z: Sending "Partners" GraphQL request:
  mutation appUpdate($apiKey: String!, $applicationUrl: Url!, $redirectUrlWhitelist: [Url]!, $appProxy: AppProxyInput) {
    appUpdate(
      input: {
        apiKey: $apiKey
        applicationUrl: $applicationUrl
        redirectUrlWhitelist: $redirectUrlWhitelist
        appProxy: $appProxy
      }
    ) {
      userErrors {
        message
        field
      }
    }
  }

With variables:
{
  "apiKey": "*****",
  "applicationUrl": "https://internship-spending-zones-goto.trycloudflare.com",
  "redirectUrlWhitelist": [
    "https://internship-spending-zones-goto.trycloudflare.com/auth/callback",
    "https://internship-spending-zones-goto.trycloudflare.com/auth/shopify/callback",
    "https://internship-spending-zones-goto.trycloudflare.com/api/auth/callback"
  ]
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

to https://partners.shopify.com/api/cli/graphql
2024-11-26T19:54:45.491Z: Request to https://partners.shopify.com/api/cli/graphql completed in 697 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"76acb4e44b91f928c3744a856cacdd2e"
 - server-timing: processing;dur=449, socket_queue;dur=5.705, util;dur=0.5, cfRequestDuration;dur=548.000097, shopifolk; desc=employee
 - x-request-id: 10e69830-cf5c-46e7-9e77-895a4b27e1af-1732650884
    
2024-11-26T19:54:45.493Z: Reading the content of file at shopify.app.toml...
2024-11-26T19:54:45.496Z: Writing some content to file at shopify.app.toml...
2024-11-26T19:54:45.504Z: Sending "Partners" GraphQL request:
  query allAppExtensionRegistrations($apiKey: String!) {
    app(apiKey: $apiKey) {
      extensionRegistrations {
        id
        uuid
        title
        type
        draftVersion {
          config
          context
        }
        activeVersion {
          config
          context
        }
      }
      configurationRegistrations {
        id
        uuid
        title
        type
        draftVersion {
          config
          context
        }
        activeVersion {
          config
          context
        }
      }
      dashboardManagedExtensionRegistrations {
        id
        uuid
        title
        type
        activeVersion {
          config
          context
        }
        draftVersion {
          config
          context
        }
      }
    }
  }

With variables:
{
  "apiKey": "*****"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

to https://partners.shopify.com/api/cli/graphql
2024-11-26T19:54:46.269Z: Request to https://partners.shopify.com/api/cli/graphql completed in 765 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"2cf109297b5991b1cd3925175e3cf095"
 - server-timing: processing;dur=661, socket_queue;dur=1.918, util;dur=0.6, cfRequestDuration;dur=723.000050, shopifolk; desc=employee
 - x-request-id: abb97678-a818-4cbc-862c-fc672366203c-1732650885
    
2024-11-26T19:54:46.274Z: Sending "Partners" GraphQL request:
  query activeAppVersion($apiKey: String!) {
    app(apiKey: $apiKey) {
      activeAppVersion {
        appModuleVersions {
          registrationId
          registrationUuid
          registrationTitle
          type
          config
          specification {
            identifier
            name
            experience
            options {
              managementExperience
            }
          }
        }
      }
    }
  }

With variables:
{
  "apiKey": "*****"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

to https://partners.shopify.com/api/cli/graphql
2024-11-26T19:54:47.194Z: Request to https://partners.shopify.com/api/cli/graphql completed in 919 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"77be898232cb7059c3eeb56ba5d0231e"
 - server-timing: processing;dur=377, socket_queue;dur=416.809, util;dur=3.8, cfRequestDuration;dur=866.999865, shopifolk; desc=employee
 - x-request-id: f0012a4d-f94e-48e9-92e2-f75c4f54f64f-1732650886
    
2024-11-26T19:54:47.203Z: Sending "Partners" GraphQL request:
  query activeAppVersion($apiKey: String!) {
    app(apiKey: $apiKey) {
      activeAppVersion {
        appModuleVersions {
          registrationId
          registrationUuid
          registrationTitle
          type
          config
          specification {
            identifier
            name
            experience
            options {
              managementExperience
            }
          }
        }
      }
    }
  }

With variables:
{
  "apiKey": "*****"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

to https://partners.shopify.com/api/cli/graphql
2024-11-26T19:54:47.764Z: Request to https://partners.shopify.com/api/cli/graphql completed in 561 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"77be898232cb7059c3eeb56ba5d0231e"
 - server-timing: processing;dur=313, socket_queue;dur=3.012, util;dur=0.4, cfRequestDuration;dur=381.999969, shopifolk; desc=employee
 - x-request-id: 76b96437-211b-4266-a79e-edddbf9d392c-1732650887
    
2024-11-26T19:54:47.773Z: Storing app information for directory /Users/sambostock/src/github.com/Shopify/app-name:{
  "directory": "/Users/sambostock/src/github.com/Shopify/app-name",
  "previousAppId": "c0274a85899009e388491e7eaf4b6b40"
}
2024-11-26T19:54:47.795Z: 
Running system process:
  · Command: npm prefix
  · Working directory: /Users/sambostock/src/github.com/Shopify/app-name

2024-11-26T19:54:48.083Z: Obtaining the dependency manager in directory /Users/sambostock/src/github.com/Shopify/app-name...
2024-11-26T19:54:48.222Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 131 ms
With response headers:
 - x-request-id: 1e31ff42-5dae-4dfc-9494-e874b8d37ef0
    
2024-11-26T19:54:48.222Z: Analytics event sent: {
  "command": "app dev",
  "time_start": 1732650873374,
  "time_end": 1732650887787,
  "total_time": 14413,
  "success": true,
  "cli_version": "3.70.0",
  "ruby_version": "",
  "node_version": "20.12.2",
  "is_employee": true,
  "uname": "darwin arm64",
  "env_ci": false,
  "env_plugin_installed_any_custom": false,
  "env_plugin_installed_shopify": "[\"@shopify/cli\"]",
  "env_shell": "zsh",
  "env_device_id": "ff91f9ca8fec0c39ac6fdceadbe854334dc1cd32",
  "env_cloud": "localhost",
  "env_package_manager": "npm",
  "env_is_global": false,
  "env_auth_method": "device_auth",
  "cmd_app_warning_api_key_deprecation_displayed": true,
  "cmd_app_all_configs_any": true,
  "cmd_app_all_configs_clients": "{\"shopify.app.toml\":\"c0274a85899009e388491e7eaf4b6b40\"}",
  "cmd_app_linked_config_used": true,
  "cmd_app_linked_config_name": "shopify.app.toml",
  "cmd_app_linked_config_git_tracked": false,
  "cmd_app_linked_config_source": "cached",
  "cmd_app_linked_config_uses_cli_managed_urls": true,
  "project_type": "node",
  "app_extensions_any": false,
  "app_extensions_breakdown": "{}",
  "app_extensions_count": 0,
  "app_extensions_custom_layout": false,
  "app_extensions_function_any": false,
  "app_extensions_function_count": 0,
  "app_extensions_theme_any": false,
  "app_extensions_theme_count": 0,
  "app_extensions_ui_any": false,
  "app_extensions_ui_count": 0,
  "app_name_hash": "7e99daa332acfe483f29ea5377cc190684ef4512",
  "app_path_hash": "3bc34e1c469adb18c738369f08b8dd2b9f3f35f0",
  "app_scopes": "[\"read_themes\",\"write_customers\",\"write_files\",\"write_metaobject_definitions\",\"write_metaobjects\",\"write_orders\",\"write_products\",\"write_sqlite_bulk_data_transfer\"]",
  "app_web_backend_any": true,
  "app_web_backend_count": 1,
  "app_web_custom_layout": true,
  "app_web_framework": "remix",
  "app_web_frontend_any": true,
  "app_web_frontend_count": 1,
  "env_package_manager_workspaces": true,
  "partner_id": 9082,
  "api_key": "****",
  "cmd_app_reset_used": false,
  "store_fqdn_hash": "88565fa46bffd33a0dea1692b63e731ebf24ec80",
  "cmd_deploy_include_config_used": true,
  "cmd_deploy_config_modules_breakdown": "[\"access_scopes\",\"application_url\",\"auth\",\"embedded\",\"handle\",\"name\",\"pos\",\"webhooks\"]",
  "cmd_deploy_config_modules_updated": "[\"application_url\",\"auth\"]",
  "cmd_dev_tunnel_type": "cloudflare",
  "cmd_dev_urls_updated": true,
  "cmd_app_dependency_installation_skipped": false,
  "cmd_all_timing_network_ms": 7066,
  "cmd_all_timing_prompts_ms": 0,
  "cmd_all_launcher": "npm",
  "cmd_all_topic": "app",
  "cmd_all_plugin": "@shopify/app",
  "cmd_all_verbose": true,
  "cmd_all_path_override": true,
  "cmd_all_path_override_hash": "3bc34e1c469adb18c738369f08b8dd2b9f3f35f0",
  "cmd_all_last_graphql_request_id": "76b96437-211b-4266-a79e-edddbf9d392c-1732650887",
  "cmd_all_timing_active_ms": 7346,
  "cmd_all_exit": "ok",
  "user_id": "ce17e958-1b56-4b1f-b134-1de54de61f8c",
  "args": "--verbose",
  "app_name": "app-name",
  "store_fqdn": "sambostock-import-test-shop.myshopify.com",
  "env_plugin_installed_all": "[\"@shopify/cli\"]",
  "metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}
2024-11-26T19:54:48.227Z: Sending "Partners" GraphQL request:
  query allAppExtensionRegistrations($apiKey: String!) {
    app(apiKey: $apiKey) {
      extensionRegistrations {
        id
        uuid
        title
        type
        draftVersion {
          config
          context
        }
        activeVersion {
          config
          context
        }
      }
      configurationRegistrations {
        id
        uuid
        title
        type
        draftVersion {
          config
          context
        }
        activeVersion {
          config
          context
        }
      }
      dashboardManagedExtensionRegistrations {
        id
        uuid
        title
        type
        activeVersion {
          config
          context
        }
        draftVersion {
          config
          context
        }
      }
    }
  }

With variables:
{
  "apiKey": "*****"
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json
 - X-Shopify-Cli-Employee: 1

to https://partners.shopify.com/api/cli/graphql
2024-11-26T19:54:49.081Z: Request to https://partners.shopify.com/api/cli/graphql completed in 854 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"264cc19762b6cb2d4e8f1cda463a1554"
 - server-timing: processing;dur=741, socket_queue;dur=2.947, util;dur=0.5, cfRequestDuration;dur=802.999973, shopifolk; desc=employee
 - x-request-id: 4e7989d9-5971-44b1-9640-b44f28450fc4-1732650888
    

2024-11-26T19:54:49.098Z: 
Running system process:
  · Command: npm exec nodemon ./server.js
  · Working directory: /Users/sambostock/src/github.com/Shopify/app-name


14:54:49 │      graphiql │ 2024-11-26T19:54:49.098Z: Setting up GraphiQL HTTP server on port 3457...

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

› Press d │ toggle development store preview: ✔ on
› Press g │ open GraphiQL (Admin API) in your browser
› Press p │ preview in your browser
› Press q │ quit

Preview URL: https://sambostock-import-test-shop.myshopify.com/admin/oauth/redirect_from_cli?client_id=c0274a85899009e388491e7eaf4b6b40
GraphiQL URL: http://localhost:3457/graphiql

Error: listen EADDRINUSE: address already in use :::3457
    at Server.setupListenHandle [as _listen2] (node:net:1897:16)
    at listenInCluster (node:net:1945:12)
    at Server.listen (node:net:2037:7)
    at app.listen (file:///Users/sambostock/src/github.com/Shopify/app-name/node_modules/@shopify/cli/dist/index.js:141590:28)
    at setupGraphiQLServer (file:///Users/sambostock/src/github.com/Shopify/app-name/node_modules/@shopify/cli/dist/index.js:171314:11)
    at launchGraphiQLServer (file:///Users/sambostock/src/github.com/Shopify/app-name/node_modules/@shopify/cli/dist/index.js:171327:20)
    at Object.action (file:///Users/sambostock/src/github.com/Shopify/app-name/node_modules/@shopify/cli/dist/index.js:172596:14)
    at Object.action (file:///Users/sambostock/src/github.com/Shopify/app-name/node_modules/@shopify/cli/dist/index.js:172212:31)
    at file:///Users/sambostock/src/github.com/Shopify/app-name/node_modules/@shopify/cli/dist/chunk-PJKCWDDX.js:30309:27
    at Array.map (<anonymous>)

Reproduction steps

  1. shopify app dev in one terminal
  2. shopify app dev in another terminal
  3. Notice the second one blows up

Operating System

macos

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

3.70.0

Shell

zsh in VSCode

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

v20.12.2

What language and version are you using in your application?

Node v20.12.2

@sambostock sambostock added the Type: Bug Something isn't working label Nov 26, 2024
@sambostock
Copy link
Author

I suspect it might be related to dev setting HOST and PORT environment variables, but I'm not sure.

@e-oj
Copy link

e-oj commented Nov 27, 2024

I'm having this issue trying to start a single server. I don't have a HOST environment variable either so it's probably different from #3578. I get this output:

╭─ warning ────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  A random port will be used for GraphiQL because `3457` is not available.    │
│                                                                              │
│  If you want to keep your session in GraphiQL, you can choose a different    │
│  one by setting the `--graphiql-port` flag.                                  │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

╭─ error ──────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Port 61982 is not available for serving GraphiQL.                           │
│                                                                              │
│  Choose a different port by setting the `--graphiql-port` flag.              │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

@e-oj
Copy link

e-oj commented Nov 27, 2024

Solved mine by setting the dev command in shopify.web.toml to

[commands]
dev = "npm exec remix vite:dev"

@aswamy
Copy link
Contributor

aswamy commented Nov 27, 2024

@sambostock

Right now, shopify app dev requires two separate ports:

  • One for --theme-app-extension-port
  • One for --graphiql-port

If you run one app with npx shopify app dev and the other with npx shopify app dev --graphiql-port=3458 --theme-app-extension-port=9294, does it work?

@isaacroldan isaacroldan added the Area: @shopify/app @shopify/app package issues label Dec 16, 2024
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

4 participants