Shopify / cli

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

[Bug]: CLI output Auth error after creating a theme app extension #772

Closed sja87 closed 1 year ago

sja87 commented 1 year ago

Please confirm that you have:

In which of these areas are you experiencing a problem?

App

Expected behavior

After enter the "npm run dev" I expected to start the local development server. The first time I create the app everything works fine. After create a theme app extension I get a auth error.

Actual behavior

After creating a theme app extension and stopping the server and try to enter "npm run dev" or "npm run dev -- --reset", I get a auth error.

I try to "shopify auth logout" and also try to clear my cookies and cache in my browser.

Error after create a theme app extension:

Bildschirm­foto 2022-11-14 um 15 30 25

After delete the theme extension folder everything works:

Bildschirm­foto 2022-11-14 um 15 33 22

Stack trace

/Users/seb/Documents/Shopify/Apps/myfirstapp/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

AbortSilent [Error]
    at execCLI2 (file:///Users/seb/Documents/Shopify/Apps/myfirstapp/node_modules/@shopify/cli-kit/dist/public/node/ruby.js:46:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.action (file:///Users/seb/Documents/Shopify/Apps/myfirstapp/node_modules/@shopify/app/dist/cli/services/dev.js:125:13)
    at async file:///Users/seb/Documents/Shopify/Apps/myfirstapp/node_modules/@shopify/cli-kit/dist/private/node/ui/components/ConcurrentOutput.js:70:17
    at async Promise.all (index 1)
    at async runProcesses (file:///Users/seb/Documents/Shopify/Apps/myfirstapp/node_modules/@shopify/cli-kit/dist/private/node/ui/components/ConcurrentOutput.js:67:13) {
  tryMessage: null,
  type: 1
}

Node.js v19.0.1

Reproduction steps

  1. npm run dev
  2. create a theme app extension (https://shopify.dev/apps/online-store/theme-app-extensions/getting-started#step-1-create-a-new-extension)
  3. npm run dev

Operating System

Mac OS 13.0.1

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

4.22.1

Shell

No response

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

v19.0.1

What language and version are you using in your application?

PHP 8.1

isaacroldan commented 1 year ago

Hi @sja87 , this is because the theme app extension needs access to your store, and by default when you create a development store from partners, the owner of that store is not the same owner as the partners organization (this is a known issue and we are working on it).

In the meantime, the workaround for this is: go to your store settings {your_store_url}/admin/settings/account and invite your partner account email as staff member of the store.

Let me know if that helps!

sja87 commented 1 year ago

@isaacroldan Great! now it works