cli: [Bug]: `shopify app dev` stops authenticating development store preview

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 should be a simple task, but it fails frequently when using it in.

Something is causing the draft previews to update, and the error below appears in red text.

Actual behavior

After some time, and usually quitting and re-running shopify app dev the error message does not appear.

When this message appears it means draft versions of app extensions, checkout extensions, theme extensions fail to update as well. It’s a huge pain because it means extra steps to continuing to work. It breaks the flow when suddenly the extension is not responding to code changes (did I introduce a bug?, did I break something?)

Verbose output

Failed to fetch the latest status of the development store preview, trying again in 5 seconds.

This error appears in RED text in the console.



### Reproduction steps

1. run `shopify app dev`
2. sometimes the error happens, which needs a full quit and restart

### Operating System

OSX

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

latest

### Shell

iterm2

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

latest

### What language and version are you using in your application?

latest

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 15 (11 by maintainers)

Most upvoted comments

Just a quick ping, been a bit busy with Winter Edition (check it out if you haven’t yet!) but I’ve also had some challenges getting the fix to work reliably. I want to fix this right, which may take a bit more time.

Anyway, just didn’t want you all thinking I’d forgotten you.

Hey folks, I recognize this took some time to figure out, but I have a repro, and this is definitely specific to theme app extensions. I have traced the root cause of the problem, made a potential fix, and am in the process of verifying.

On another note, @scerelli I wanted to ask you about this:

It’s really frustrating as i also need to reconfigure the dev theme, linked to my theme app extension, every time i restart dev because it doesn’t keep my configurations.

Can you please elaborate more on what you mean when you say “it doesn’t keep my configurations”? This sounds like useful feedback that we’d love to know more about.

Totally understand, It’s definitely strange…

Im logged into the browser, in my dev store, in the partner dashboard, etc. All seems to be fine.

The auth appears to fail a lot - my network is stable (Starlink), wonder why are the auth tokens so short lived? Seems like every 2-5 minutes they are expired.

This is occurs specifically when working on theme extensions, where code changes are pushing to development store preview - draft themes.

When a local code change occurs, this appears in the CLI console: 14:17:45 │ extensions │ Pushed » 'theme-extension' to a draft

Then when the auth has failed - nothing happens after saving a code change.

Just trying to provide more info to see if something rings a bell. I appreciate the help here, it’s one of those things that adds a few extra steps every couple of minutes, and confusing when silently failed as my code change isn’t reflected in the draft theme editor.

Hi @awd, I think the development store preview message is a red herring. That’s a polling check for whether development store preview is enabled or disabled, but it has nothing to do with pushing your extensions.

It sounds, though, like it happens at the same time that draft-pushing stops. Which means there’s some kind of authentication issue (e.g. the token expired) and CLI requires a restart, but can’t prompt you to reauthenticate mid-dev. It might even be best to crash at that point vs. continuing to run but not being fully functional.

It would definitely help to run in --verbose mode and see any details on the error, but there will be huge amounts of text to sort through. So it’s probably best if you can indicate a minimal repro, or at the very least any steps that would make this issue more likely to happen, so we can investigate more fully. Is it just a matter of waiting long enough?