v3.38.0 | shopify theme dev | Staging IP issue

Topic summary

Issue: After upgrading to Shopify CLI v3.38.0, users encounter an AbortError: invalid_target when running shopify theme dev. The command prompts for login but fails to render the staging URL, preventing theme development preview.

Error Details:

  • Occurs during authentication/token exchange process
  • Stack trace points to session management in @shopify/cli-kit
  • Affects multiple users across different setups

Workaround: One user successfully resolved the issue by adding the --store flag with their store URL:

shopify theme dev --store {your-store-url}

This flag is only needed once during initial login; subsequent runs work without it.

Status: Multiple users report experiencing the same problem. The workaround appears effective but the root cause in v3.38.0 remains unaddressed. Several participants are still seeking solutions or confirmation of the fix.

Summarized with AI on November 18. AI used: claude-sonnet-4-5-20250929.

After upgrading to Shopify cli 3.38.0, I’m now running into this issue trying view my theme updates on the staging url in my browser. Upon pressing any key after the prompt, I’m directed to log in with my credentials in my browser; however the staging url is no longer rendering in the Shopify CLI. Any ideas on how to resolve?

shopify theme dev

To run this command, log in to Shopify Partners.
 Press any key to open the login page on your browser
/opt/homebrew/Cellar/shopify-cli/3.38.0/libexec/lib/node_modules/@shopify/cli/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

AbortError: invalid_target
    at tokenRequestErrorHandler (file:///opt/homebrew/Cellar/shopify-cli/3.38.0/libexec/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/dist/private/node/session/exchange.js:130:12)
    at Err.mapError (file:///opt/homebrew/Cellar/shopify-cli/3.38.0/libexec/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/dist/public/node/result.js:130:20)
    at requestAppToken (file:///opt/homebrew/Cellar/shopify-cli/3.38.0/libexec/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/dist/private/node/session/exchange.js:115:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async exchangeAccessForApplicationTokens (file:///opt/homebrew/Cellar/shopify-cli/3.38.0/libexec/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/dist/private/node/session/exchange.js:46:23)
    at async executeCompleteFlow (file:///opt/homebrew/Cellar/shopify-cli/3.38.0/libexec/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/dist/private/node/session.js:114:20)
    at async ensureAuthenticated (file:///opt/homebrew/Cellar/shopify-cli/3.38.0/libexec/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/dist/private/node/session.js:48:22)
    at async ensureAuthenticatedAdmin (file:///opt/homebrew/Cellar/shopify-cli/3.38.0/libexec/lib/node_modules/@shopify/theme/node_modules/@shopify/cli-kit/dist/public/node/session.js:62:20)
    at async Dev.execute (file:///opt/homebrew/Cellar/shopify-cli/3.38.0/libexec/lib/node_modules/@shopify/theme/dist/cli/commands/theme/dev.js:39:30) {
  tryMessage: null,
  type: 0,
  nextSteps: undefined
}
4 Likes

I am also experiencing this issue

Had the same problem here. I got it working by adding the store URL flag: shopify theme dev --store {your store url}. This is only needed one time after logging in successfully, and the URL flag is not required after.

I am also experiencing this issue

I have same issues!

I have the same issues, someone can help me.

Have you found a solution yet?