I encountered a really strange issue on one of my development stores last night. I had installed my app which contained a Cart Transform function, and was working perfectly fine with the app being served from my dev machine (npm run dev). I shutdown my app, then the next day, continued development on my dev store. When adding an item to the cart, I noticed that the Cart Transform was still running as my items were being transformed from the base product to the bundle parent product?!?! How can this be if my app is shutdown? I contacted Shopify support, they had no issue adding items to the cart, and no transforms were happening for them. I then tested on different themes, different devices, different browsers, and different networks (with different public IPs), and still noticed the item added to cart was being transformed to the parent bundle?!?!? I then uninstalled my app containing the function, and only ~15 minutes later were items being added to the cart without being transformed.
Has anyone experienced something similar?
If it is turn on, you can turn it off and try it.
Thanks! Didn’t think of that. And also didn’t think that option would have any effect, considering my app was shutdown (i.e. no function code to refer to). Strange thing is, only I was experiencing the issue, and across multiple devices (as mentioned in my post), yet Support was not experiencing the issue at all. Very strange indeed!
Did it solve the problem?
Haven’t been able to test it yet. Again, it was very strange that only I was experiencing the issue (across multiple devices, browsers, and networks) and yet, Support was accessing my dev store with no issue at all. The fact we were accessing the same store leads me to believe this setting would not have changed anything. But I will test to be thorough
I think this switch is specifically designed to function in this way. Again, it is useful to test. Moreover, Did you run the ‘npm run deploy’ command?
Unlike your embedded app, Functions run on Shopify. For Functions, npm run dev continually pushes draft code to Shopify. If Development Store Preview is enabled, that draft code will continue to be used on the shop, even after dev shuts down. If you have run deploy, that code will continue to run, even without preview enabled.
Thanks @Nick_Wesselman , good to know. Is all this documented anywhere? I’ll definitely keep this in mind.
I am aware that Functions run on Shopify servers, but thought once the app containing the function was shutdown, the/app function would terminate as well. I guess not 
What really threw us for a loop was that only I was experiencing the issue, and across browsers, devices, and networks.
Interesting @Nick_Wesselman . With my function running (npm run dev) and with “toggle development store preview on”, the functions works fine. With the function still running, and toggling preview to off, the function no longer works. So is the process to both shutdown the function (i.e. stop npm run dev) and turn off “development store preview”? This is confusing and should be formally documented 
To further clarify, running ‘dev’ does a few things for Functions and other app extensions –
- Builds and pushes them to your app’s draft version on Shopify.
- Enables a file watcher to rebuild and push changes to the draft version.
- Enables ‘development store preview’ on your app, which activates the draft version on any Partner test/development shops where the app is installed.
Shutting down ‘dev’ automatically disables the ‘development store preview’. There’s not a Function to “shut down” locally, since it’s all deployed to Shopify. So turning off the preview in Partners should be no different than quitting ‘dev’.
Also note that this is a global setting on your app which is being toggled by ‘dev’, so you shouldn’t share that app instance between developers.
Agreed that ‘dev’ behavior is confusing, we have some roadmap to address this. But does this explanation help?
Appreciate the clarity. Still a bit confusing, since you say “Shutting down ‘dev’ automatically disables the ‘development store preview’”.
In my case, I stopped ‘npm run dev’, which should have also disabled the development store preview. If this is supposed to be the case, then why did my cart transform continue to run? It wasn’t until I uninstalled the app containing my function from my dev store that the cart transform stopped running and my cart to returned to ‘normal’ behaviour. Even weirder was that only I was experiencing the issue, and across devices, browsers, and networks, while the support rep could not reproduce the issue.
Perhaps there’s some further bugs to iron out… 