Shopify app dev doesn't work with Plus development stores

Hi all.

We have a Plus Organization with two stores in it: production and development.

The development store was created through the regular admin UI with the purposes of:

  • developing and testing a custom theme
  • developing and testing a custom app

Said theme and app are only going to be installed in our production and development stores, they are not meant for distribution. Therefore we do not want to set up a Partners account.

Theme development seems fine with this setup - shopify theme dev links to our dev store and works fine.

App development seems broken. I’ve created the app in the Dev Dashboard, and I can deploy it and install it in both our prod and dev stores.

However, when I try shopify app dev it just doesn’t detect our development store. I tried specifying it explicitly with -s, but CLI fails and says the store is not found in the organisation.

When I check the Dev Dashboard, the dev store doesn’t show up there.

How can I develop the app using the dev store we have?

Creating another development store just to work on the app is not an acceptable option. The dev store we already have is set up within our Plus Organization which allows proper access management. It has all our data in it as well.

Hi @anna-oake,

At this time app dev only supports stores created via the Dev Dash. Apps have a higher blast radius than themes, so we are more restrictive about where you can use dev.

That said, we hear your feedback and are looking for ways we can improve this.

Would you mind sharing how large your development team is? One consideration here is team development, since app dev uses the store scope for sandboxing between developers.

-Nick

Hey there, I just wanted to share an implementation that I found useful to get around the limitation of using shopify app dev within a live store. Some things to note:

  • Use this implementation at your own risk. This obviously can affect live store data. I was only comfortable using this solution because I have a private app on my own personal company shopify
  • I am using a remix app
  • There are still limitations and I still advise to work within a test store. I would akin this more as a staging, final testing, rather than a dev app.

Ok, so I have 3 running instances of my shopify app: prod, dev (staging) and test. Prod and dev are both installed on my live store, whereas test is installed on my development test store. To be clear, all 3 apps are separate in my partners dev dashboard with their own client id, secrets etc.

In order for Dev to run on my live store, I set the .toml config application_url to a permanent ngrok url tunnel that is ported to my local host when I run it. I start my ngrok tunnel and then my remix app locally. I DO NOT USE shopify app dev to run my dev app. When you deploy your shopify app toml (shopify app deploy --config dev.toml) your corresponding app will update with the tunnel url as your application url. This is what allows you to run your app locally without using shopify app dev, as it is basically the same as running your app with a hosted url.

For my test app, I run it normally with shopify app dev --config test.toml since I am using it on a development store.

When I am not developing the app I either change the toml application_url to a hosted environment and deploy it to shopify or just uninstall the app.

Some gotcha’s:

  • make sure to run your dev app locally with the correct environment variables needed for shopify auth (shopify app client id, secret, etc.). They must match the toml you deployed
  • you need to have the app running locally when you install. Since it is running in a tunnel to localhost it still needs to be able to hit the needed webhooks on installation.
  • I have a separate toml file for each app. I always run shopify cli scripts with –config foo.toml in order to be extra safe on what is happening.
  • BE VERY CAREFUL using webhooks. It will double subscribe with your production app. For instance, orders/create will hit both prod and dev on the live store. If you apps do not have separate databases or are running admin actions, this will most likely cause you some issues. This warning probably applies to any pub/sub functionality and most likely some hidden other things that I cant think of.