Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
425 stars 130 forks source link

[Bug]: npm run dev fail to run theme app extensions #3143

Closed vantrangaof closed 11 months ago

vantrangaof commented 11 months ago

Please confirm that you have:

In which of these areas are you experiencing a problem?

App, Extension

Expected behavior

After running npm run dev, the extension should be able to be previewed along with the rest of the project.

Actual behavior

When the app is first created, the preview works fine. However, after installing the theme app extensions, the preview crashed. I can still deploy the app, just couldn't preview it.

Verbose output

> predev
> prisma generate && prisma migrate deploy

Prisma schema loaded from prisma/schema.prisma

✔ Generated Prisma Client (4.16.2 | library) to ./node_modules/@prisma/client in 155ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "dev.sqlite" at "file:dev.sqlite"

1 migration found in prisma/migrations

No pending migrations to apply.

> dev
> shopify app dev --verbose

2023-11-25T06:55:30.336Z: Running command app dev
2023-11-25T06:55:30.347Z: Getting a random port...
2023-11-25T06:55:30.358Z: Random port obtained: 51825
2023-11-25T06:55:30.387Z: 
Running system process:
  · Command: /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test/node_modules/@shopify/plugin-cloudflare/bin/cloudflared tunnel --url http://localhost:51825 --no-autoupdate
  · Working directory: /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test

2023-11-25T06:55:30.395Z: Ensuring that the user is authenticated with the Partners API with the following scopes:
[]

2023-11-25T06:55:30.416Z: Getting session store...
2023-11-25T06:55:30.426Z: 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-25T06:55:30.428Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2023-11-25T06:55:30.443Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
 - User-Agent: Shopify CLI; v=3.51.1
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2023-11-25T06:55:30.634Z: 2023-11-25T06:55:30Z 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-25T06:55:30.635Z: 2023-11-25T06:55:30Z INF Requesting new quick Tunnel on trycloudflare.com...

2023-11-25T06:55:30.939Z: Request to https://accounts.shopify.com/oauth/introspection completed in 468 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/"ea0232dc4d514325a58189a0f441bb8d"
 - x-request-id: bf7add84-fa07-444b-93cc-95afdf7d1d05

2023-11-25T06:55:30.954Z: The identity token is valid: true
2023-11-25T06:55:30.955Z: 
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-25T06:55:30.955Z: Verifying that the user has a Partner organization
2023-11-25T06:55:30.963Z: Sending "Partners" GraphQL request:
  {
    organizations(first: 1) {
      nodes {
        id
      }
    }
  }

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

2023-11-25T06:55:31.548Z: Request to https://partners.shopify.com/api/cli/graphql completed in 520 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"4196dbb2504b6acccaf096b85ddc0790"
 - x-request-id: 25c6d032-d1a0-4884-b7ab-659c8267dc5e

2023-11-25T06:55:31.555Z: Sending "Partners" GraphQL request:
  query currentAccountInfo {
    currentAccountInfo {
      __typename
      ... on ServiceAccount {
        orgName
      }
      ... on UserAccount {
        email
      }
    }
  }

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

2023-11-25T06:55:31.956Z: 2023-11-25T06:55:31Z INF +--------------------------------------------------------------------------------------------+
2023-11-25T06:55:31Z INF |  Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):  |

2023-11-25T06:55:31.957Z: 2023-11-25T06:55:31Z INF |  https://elect-preference-conservation-col.trycloudflare.com                               |
2023-11-25T06:55:31Z INF +--------------------------------------------------------------------------------------------+

2023-11-25T06:55:31.971Z: 2023-11-25T06:55:31Z INF Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]

2023-11-25T06:55:31.971Z: 2023-11-25T06:55:31Z INF Version 2023.5.1
2023-11-25T06:55:31Z INF GOOS: darwin, GOVersion: go1.19.3, GoArch: amd64

2023-11-25T06:55:31.972Z: 2023-11-25T06:55:31Z INF Settings: map[ha-connections:1 no-autoupdate:true protocol:quic url:http://localhost:51825]

2023-11-25T06:55:31.983Z: 2023-11-25T06:55:31Z INF Generated Connector ID: 9df161ff-31f4-41cc-8614-66ca63fe3d56

2023-11-25T06:55:32.021Z: 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/"c6ee43893aaca130b7a3270ebae3d26b"
 - x-request-id: 3e4e4841-f905-4201-a346-8d9df3631f21

2023-11-25T06:55:32.028Z: Reading cached app information for directory /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test...
2023-11-25T06:55:32.040Z: Reading cached app information for directory /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test...
2023-11-25T06:55:32.041Z: 2023-11-25T06:55:32Z INF Initial protocol quic
2023-11-25T06:55:32Z INF ICMP proxy will use 192.168.1.46 as source for IPv4
2023-11-25T06:55:32Z INF ICMP proxy will use fe80::14aa:fdd9:c73e:dd85 in zone en0 as source for IPv6

2023-11-25T06:55:32.044Z: 2023-11-25T06:55:32Z INF Created ICMP proxy listening on 192.168.1.46:0

2023-11-25T06:55:32.044Z: 2023-11-25T06:55:32Z INF Created ICMP proxy listening on [fe80::14aa:fdd9:c73e:dd85%en0]:0

2023-11-25T06:55:32.046Z: Reading cached app information for directory /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test...
2023-11-25T06:55:32.048Z: Reading the content of file at shopify.app.toml...
2023-11-25T06:55:32.056Z: Reading the content of file at shopify.app.toml...
2023-11-25T06:55:32.062Z: Reading the content of file at shopify.app.toml...
2023-11-25T06:55:32.189Z: 2023-11-25T06:55:32Z INF Starting metrics server on 127.0.0.1:51833/metrics

2023-11-25T06:55:32.209Z: 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
    }
  }

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

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

2023-11-25T06:55:32.580Z: 2023-11-25T06:55:32Z WRN Your version 2023.5.1 is outdated. We recommend upgrading it to 2023.10.0

2023-11-25T06:55:33.026Z: 2023-11-25T06:55:33Z INF Registered tunnel connection connIndex=0 connection=6116bc69-cac8-4b13-8a55-57d948dad9dc event=0 ip=198.41.192.37 location=hkg10 protocol=quic

2023-11-25T06:55:33.286Z: Request to https://partners.shopify.com/api/cli/graphql completed in 1074 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"eef4c0b25c242705fc895f631907804e"
 - x-request-id: 8d9160aa-f7d5-4ba5-b997-e78b52695b3d

2023-11-25T06:55:33.293Z: Sending "Partners" GraphQL request:
  query FindOrganization($id: ID!) {
    organizations(id: $id, first: 1) {
      nodes {
        id
        businessName
        website
      }
    }
  }

With variables:
{
  "id": "916523"
}

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

2023-11-25T06:55:33.751Z: Request to https://partners.shopify.com/api/cli/graphql completed in 457 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"1a4aa399a88d5f0ad200b73f5badc263"
 - x-request-id: d7d78bcf-389d-4321-916b-680f30c6efb9

2023-11-25T06:55:33.756Z: Sending "Partners" GraphQL request:
  query FindOrganization($id: ID!, $shopDomain: String) {
    organizations(id: $id, first: 1) {
      nodes {
        id
        businessName
        website
        stores(shopDomain: $shopDomain, first: 1, archived: false) {
          nodes {
            shopId
            link
            shopDomain
            shopName
            transferDisabled
            convertableToPartnerTest
          }
        }
      }
    }
  }

With variables:
{
  "id": "916523",
  "shopDomain": "trang-checkout-extensibility.myshopify.com"
}

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

2023-11-25T06:55:34.400Z: Request to https://partners.shopify.com/api/cli/graphql completed in 641 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"b81307144517668563105218095f6538"
 - x-request-id: fdb5dbba-0a34-455e-83dc-d2ae516f2883

2023-11-25T06:55:34.404Z: File-writing some content to file at shopify.app.toml...
╭─ info ───────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Using shopify.app.toml:                                                     │
│                                                                              │
│    • Org:          AkoCommerce Agency                                        │
│    • App:          trang-app-extensions-test                                 │
│    • Dev store:    trang-checkout-extensibility.myshopify.com                │
│    • Update URLs:  Yes                                                       │
│                                                                              │
│   You can pass `--reset` to your command to reset your app configuration.    │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

2023-11-25T06:55:34.460Z: Sending "Partners" GraphQL request:
  query fetchSpecifications($api_key: String!) {
    extensionSpecifications(apiKey: $api_key) {
      name
      externalName
      externalIdentifier
      identifier
      gated
      options {
        managementExperience
        registrationLimit
      }
      features {
        argo {
          surface
        }
      }
    }
  }

With variables:
{
  "api_key": "****"
}

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

2023-11-25T06:55:35.027Z: Request to https://partners.shopify.com/api/cli/graphql completed in 565 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"274cf97a9df248fc11ae7a7237f1f9bd"
 - x-request-id: f6af90ab-5304-4718-9994-318149a1f9a2

2023-11-25T06:55:35.091Z: Reading cached app information for directory /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test...
2023-11-25T06:55:35.092Z: Reading the content of file at shopify.app.toml...
2023-11-25T06:55:35.093Z: Reading the content of file at shopify.app.toml...
2023-11-25T06:55:35.096Z: Reading the content of file at shopify.app.toml...
2023-11-25T06:55:35.172Z: Reading the content of file at extensions/trang-extensions/shopify.extension.toml...
2023-11-25T06:55:35.178Z: Reading the content of file at package.json...
2023-11-25T06:55:35.179Z: Reading the content of file at package.json...
2023-11-25T06:55:35.181Z: Obtaining the dependency manager in directory /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test...
2023-11-25T06:55:35.195Z: Reading the content of file at shopify.web.toml...
2023-11-25T06:55:35.207Z: Reading the content of file at package.json...
2023-11-25T06:55:35.213Z: Polling tunnel status for cloudflare (attempt 0): connected
2023-11-25T06:55:35.213Z: Getting a random port...
2023-11-25T06:55:35.217Z: Random port obtained: 51838
2023-11-25T06:55:35.218Z: Sending "Partners" GraphQL request:
  query getApp($apiKey: String!) {
    app(apiKey: $apiKey) {
      applicationUrl
      redirectUrlWhitelist
      appProxy {
        url
        subPath
        subPathPrefix
      }
    }
  }

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

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

2023-11-25T06:55:36.076Z: Request to https://partners.shopify.com/api/cli/graphql completed in 857 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"a535b3e339260d3d778bf885b68e92ac"
 - x-request-id: ff64cbc1-f87f-4cfd-8af2-ce9cca8e7955

2023-11-25T06:55:36.084Z: 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://elect-preference-conservation-col.trycloudflare.com",
  "redirectUrlWhitelist": [
    "https://elect-preference-conservation-col.trycloudflare.com/auth/callback",
    "https://elect-preference-conservation-col.trycloudflare.com/auth/shopify/callback",
    "https://elect-preference-conservation-col.trycloudflare.com/api/auth/callback",
    "https://elect-preference-conservation-col.trycloudflare.com/.shopify/graphiql/auth/callback"
  ]
}

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

2023-11-25T06:55:37.003Z: Request to https://partners.shopify.com/api/cli/graphql completed in 917 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"76acb4e44b91f928c3744a856cacdd2e"
 - x-request-id: cdb2858a-8a24-4d73-ab1c-23e860b6bfe5

2023-11-25T06:55:37.004Z: File-writing some content to file at shopify.app.toml...
2023-11-25T06:55:37.008Z: Getting a random port...
2023-11-25T06:55:37.010Z: Random port obtained: 51842
2023-11-25T06:55:37.011Z: Ensuring that the user is authenticated with the Admin API with the following scopes for the store trang-checkout-extensibility.myshopify.com:
[]

2023-11-25T06:55:37.011Z: Getting session store...
2023-11-25T06:55:37.011Z: 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:
{
  "adminApi": {
    "scopes": [],
    "storeFqdn": "trang-checkout-extensibility.myshopify.com"
  }
}

2023-11-25T06:55:37.012Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2023-11-25T06:55:37.012Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
 - User-Agent: Shopify CLI; v=3.51.1
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2023-11-25T06:55:37.434Z: Request to https://accounts.shopify.com/oauth/introspection completed in 420 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/"ea0232dc4d514325a58189a0f441bb8d"
 - x-request-id: fa39ed96-b1ad-4418-83c4-e6ddb376dcf3

2023-11-25T06:55:37.435Z: The identity token is valid: true
2023-11-25T06:55:37.435Z: 
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-25T06:55:37.436Z: Getting host theme...
2023-11-25T06:55:37.966Z: Request to https://trang-checkout-extensibility.myshopify.com/admin/api/unstable/themes/162868166932.json?fields=id%2Cprocessing completed in 525 ms
With response headers:
 - content-type: application/json; charset=utf-8
 - x-request-id: 4f18d97f-4ec5-414d-9a70-242427d6c8c2

2023-11-25T06:55:37.970Z: Ensuring that the user is authenticated with the Storefront API with the following scopes:
[]

2023-11-25T06:55:37.970Z: Getting session store...
2023-11-25T06:55:37.971Z: 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:
{
  "storefrontRendererApi": {
    "scopes": []
  }
}

2023-11-25T06:55:37.971Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2023-11-25T06:55:37.972Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
 - User-Agent: Shopify CLI; v=3.51.1
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2023-11-25T06:55:37.977Z: Sending "Partners" GraphQL request:
  query allAppExtensionRegistrations($apiKey: String!) {
    app(apiKey: $apiKey) {
      extensionRegistrations {
        id
        uuid
        title
        type
        draftVersion {
          config
        }
        activeVersion {
          config
        }
      }
      dashboardManagedExtensionRegistrations {
        id
        uuid
        title
        type
        activeVersion {
          config
        }
        draftVersion {
          config
        }
      }
    }
  }

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

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

2023-11-25T06:55:38.404Z: Request to https://accounts.shopify.com/oauth/introspection completed in 430 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/"ea0232dc4d514325a58189a0f441bb8d"
 - x-request-id: 59aa6399-3bf0-466f-94f6-d7013da56eb3

2023-11-25T06:55:38.405Z: The identity token is valid: true
2023-11-25T06:55:38.405Z: 
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-25T06:55:38.774Z: Request to https://partners.shopify.com/api/cli/graphql completed in 793 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"5b4c10efac32f9e2b0b3f20ac4ccfea7"
 - x-request-id: 474b6d09-e94e-4205-9827-726d92378737

2023-11-25T06:55:38.777Z: Storing app information for directory /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test:{
  "directory": "/Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test",
  "previousAppId": "b0e6b1c6472dc39b424164763debdfb0"
}
2023-11-25T06:55:38.793Z: Obtaining the dependency manager in directory /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test...
2023-11-25T06:55:38.807Z: 
Running system process:
  · Command: ruby -v
  · Working directory: /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test

2023-11-25T06:55:39.468Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 405 ms
With response headers:
 - x-request-id: 84057440-14de-4dae-bef9-dedcf0dad7ba

2023-11-25T06:55:39.469Z: Analytics event sent: {
  "command": "app dev",
  "time_start": 1700895330337,
  "time_end": 1700895338785,
  "total_time": 8448,
  "success": true,
  "cli_version": "3.51.1",
  "ruby_version": "3.1.0",
  "node_version": "18.16.1",
  "is_employee": false,
  "uname": "darwin amd64",
  "env_ci": false,
  "env_plugin_installed_any_custom": false,
  "env_plugin_installed_shopify": "[\"@shopify/app\",\"@shopify/cli\",\"@shopify/plugin-cloudflare\",\"@shopify/plugin-did-you-mean\"]",
  "env_shell": "zsh",
  "env_device_id": "05762bdc2f59773c5116af197cae5012891900eb",
  "env_cloud": "localhost",
  "env_package_manager": "npm",
  "cmd_app_warning_api_key_deprecation_displayed": false,
  "cmd_app_all_configs_any": true,
  "cmd_app_all_configs_clients": "{\"shopify.app.toml\":\"b0e6b1c6472dc39b424164763debdfb0\"}",
  "cmd_app_linked_config_used": true,
  "cmd_app_linked_config_name": "shopify.app.toml",
  "cmd_app_linked_config_git_tracked": true,
  "cmd_app_linked_config_source": "cached",
  "cmd_app_linked_config_uses_cli_managed_urls": true,
  "partner_id": 916523,
  "api_key": "b0e6b1c6472dc39b424164763debdfb0",
  "project_type": "node",
  "app_extensions_any": true,
  "app_extensions_breakdown": "{\"theme\":1}",
  "app_extensions_count": 1,
  "app_extensions_custom_layout": false,
  "app_extensions_function_any": false,
  "app_extensions_function_count": 0,
  "app_extensions_theme_any": true,
  "app_extensions_theme_count": 1,
  "app_extensions_ui_any": false,
  "app_extensions_ui_count": 0,
  "app_name_hash": "ee85f99f5711ab9b8f73f2d73528f59d33d70c8e",
  "app_path_hash": "a432ba6f9b9fe11faa452742da85a721c377d03e",
  "app_scopes": "[\"write_products\"]",
  "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,
  "cmd_dev_urls_updated": true,
  "store_fqdn_hash": "00cbbfd35f5c7b903935ded59b7ea3b4b0dbda6c",
  "cmd_app_dependency_installation_skipped": false,
  "cmd_app_reset_used": false,
  "cmd_all_timing_network_ms": 7809,
  "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": "a432ba6f9b9fe11faa452742da85a721c377d03e",
  "cmd_all_timing_active_ms": 638,
  "cmd_all_exit": "ok",
  "args": "--verbose",
  "app_name": "trang-app-extensions-test",
  "store_fqdn": "trang-checkout-extensibility.myshopify.com",
  "env_plugin_installed_all": "[\"@shopify/app\",\"@shopify/cli\",\"@shopify/plugin-cloudflare\",\"@shopify/plugin-did-you-mean\"]",
  "metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}
2023-11-25T06:55:39.483Z: Sending "Partners" GraphQL request:
  query allAppExtensionRegistrations($apiKey: String!) {
    app(apiKey: $apiKey) {
      extensionRegistrations {
        id
        uuid
        title
        type
        draftVersion {
          config
        }
        activeVersion {
          config
        }
      }
      dashboardManagedExtensionRegistrations {
        id
        uuid
        title
        type
        activeVersion {
          config
        }
        draftVersion {
          config
        }
      }
    }
  }

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

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

2023-11-25T06:55:40.291Z: Request to https://partners.shopify.com/api/cli/graphql completed in 806 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"5b4c10efac32f9e2b0b3f20ac4ccfea7"
 - x-request-id: 7814b5fd-726b-4925-98b6-3faafcae2de0

2023-11-25T06:55:40.311Z: 
Running system process:
  · Command: npm exec remix dev
  · Working directory: /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test

2023-11-25T06:55:40.344Z: Sending "Partners" GraphQL request:
  mutation DevelopmentStorePreviewUpdate($input: DevelopmentStorePreviewUpdateInput!) {
    developmentStorePreviewUpdate(input: $input) {
      app {
        id
        developmentStorePreviewEnabled
      }
      userErrors {
        message
        field
      }
    }
  }

With variables:
{
  "input": {
    "apiKey": "b0e6b1c6472dc39b424164763debdfb0",
    "enabled": true
  }
}

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

2023-11-25T06:55:40.378Z: 
Running system process:
  · Command: ruby -v
  · Working directory: /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test

2023-11-25T06:55:40.545Z: 
Running system process:
  · Command: bundle -v
  · Working directory: /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test

2023-11-25T06:55:41.202Z: 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/"d585c52272a8aee4bb0eaef7d6a0bfb2"
 - x-request-id: 8d24b390-8499-4bd0-b083-b75f95c01156

2023-11-25T06:55:41.357Z: Reading the content of file at node_modules/@shopify/cli-kit/assets/cli-ruby/Gemfile...
2023-11-25T06:55:41.362Z: 
Running system process:
  · Command: bundle install
  · Working directory: /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test/node_modules/@shopify/cli-kit/assets/cli-ruby

2023-11-25T06:55:42.709Z: 
Running system process:
  · Command: bundle exec ruby /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify extension serve /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test/extensions/trang-extensions --api-key b0e6b1c6472dc39b424164763debdfb0 --extension-id 33575108609 --extension-title trang-extensions --extension-type THEME_APP_EXTENSION --theme 162868166932 --generate-tmp-theme
  · Working directory: /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test

13:55:43 │ extensions │ <internal:marshal>:34:in `load': marshal data too short (ArgumentError)
13:55:43 │ extensions │         from /Users/trangvan/.rbenv/versions/3.1.0/lib/ruby/3.1.0/pstore.rb:484:in `load'
13:55:43 │ extensions │         from /Users/trangvan/.rbenv/versions/3.1.0/lib/ruby/3.1.0/pstore.rb:404:in `load_data'
13:55:43 │ extensions │         from /Users/trangvan/.rbenv/versions/3.1.0/lib/ruby/3.1.0/pstore.rb:330:in `transaction'
13:55:43 │ extensions │         from /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extension
s-test/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/db.rb:86:in `get'
13:55:43 │ extensions │         from /Users/trangvan/.rbenv/versions/3.1.0/lib/ruby/3.1.0/forwardable.rb:238:in `get'
13:55:43 │ extensions │         from /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extension
s-test/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/migrator.rb:28:in `last_migration_date'
13:55:43 │ extensions │         from /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extension
s-test/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/migrator.rb:11:in `migrate'
13:55:43 │ extensions │         from /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extension
s-test/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli.rb:180:in `<module:ShopifyCLI>'
13:55:43 │ extensions │         from /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extension
s-test/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli.rb:42:in `<top (required)>'
13:55:43 │ extensions │         from /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extension
s-test/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'
13:55:43 │ extensions │         from /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extension
s-test/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'
13:55:43 │ extensions │         from /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extension
s-test/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/load_shopify.rb:18:in `<top (required)>'
13:55:43 │ extensions │         from /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extension
s-test/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:45:in `require_relative'
13:55:43 │ extensions │         from /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extension
s-test/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:45:in `<main>'
2023-11-25T06:55:43.619Z: Killing process 9801: npm exec remix dev
2023-11-25T06:55:43.644Z: Closing reverse HTTP proxy
2023-11-25T06:55:43.644Z: Killing process 9896: bundle exec ruby /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify extension serve /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test/extensions/trang-extensions --api-key b0e6b1c6472dc39b424164763debdfb0 --extension-id 33575108609 --extension-title trang-extensions --extension-type THEME_APP_EXTENSION --theme 162868166932 --generate-tmp-theme
2023-11-25T06:55:43.669Z: Sending "Partners" GraphQL request:
  mutation DevelopmentStorePreviewUpdate($input: DevelopmentStorePreviewUpdateInput!) {
    developmentStorePreviewUpdate(input: $input) {
      app {
        id
        developmentStorePreviewEnabled
      }
      userErrors {
        message
        field
      }
    }
  }

With variables:
{
  "input": {
    "apiKey": "b0e6b1c6472dc39b424164763debdfb0",
    "enabled": false
  }
}

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

2023-11-25T06:55:43.692Z: Killing process 9887: node /Users/trangvan/Desktop/trang-shopify-apps/trang-app-extensions-test/trang-app-extensions-test/node_modules/.bin/remix dev
2023-11-25T06:55:44.453Z: Request to https://partners.shopify.com/api/cli/graphql completed in 779 ms
With response headers:
 - cache-control: max-age=0, private, must-revalidate
 - content-type: application/json; charset=utf-8
 - etag: W/"dc306c8743877d23a788c77a552627e5"
 - x-request-id: 1adff84e-55ee-4351-b622-bbd8e5118967

Reproduction steps

  1. Install app: npm init @shopify/app@latest
  2. Run npm run dev: at this stage, the preview works perfectly
  3. Install extension with npm shopify app generate extension: it crashed and couldn't preview *There is no issue with the app and extension deployment

Operating System

MacOS Ventura 13.5.2

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

3.51.1

Shell

zsh

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

v18.16.1

What language and version are you using in your application?

Ruby 3.1.0

amcaplan commented 11 months ago

Hi @vantrangaof, it looks like the file where Shopify CLI stores your settings has become corrupted. I recommend deleting the file and starting again.

The file should be located at ~/.cache/shopify/.db.pstore

Your next run of the CLI will be a bit slower, but it should work afterwards!

vantrangaof commented 11 months ago

Hi @amcaplan, it works perfectly now. Thank you so much for your solution. 😊