I am building an embedded Shopify app with Rails / Webpacker and shopify_app gem, which uses React on the front end. I am able to render components and enjoy all the React goodies except for one – hot module reloading (HMR).
I know that Node / Next.js / Koa apps are able to utilize HMR and I am trying to figure out how to do this with my poor old Rails app.
I noticed that HMR polling pings are getting denied with:
ShopifyApp client received [object Object] from unknown origin [my_ngrok_instance]. Expected https://[my_store_name].myshopify.com.
Seemingly, there is no way to pass multiple origins in ShopfyApp initializer, but maybe there is a way to let Shopify know that my local dev domain is allowed.
Here is an SO question from someone who is having the same exact issue: https://stackoverflow.com/q/56573231/3284936