Hello.
Thanks for the tutorial it worked as expected until step 3 add Shopify App Bridge. I have copied the code as instructed to test my configuration. When viewing the test app on the “Unhandled Runtime Error AppBridgeError: APP::ERROR::INVALID_CONFIG: shopOrigin must be provided”
I cannot see any relation between the HOST property and the shopOrigin cookie.
The reason why you get this error is because in _app.js the config object for the app-bridge-react Provider has undefined value for shopOrigin. In the demo app the value is set from the cookie named shopOrigin. Which, on the other hand, is set on afterAuth by koa-auth-shopify. Check those to track if shopOrigin is set properly.
Glad it helps. However, this way does not cover all, since afterAuth wasn’t invoked all the time (follow Shopify tutorial). My final solution is to attach a middleware to check if shopOrigin exists and update one if needed. I am not sure if this way is the right answer, but it works for me.
Frankly, re-login is not the solution to this issue. Browser doesn’t find shopOrigin cookie causing the issue. There are many reasons cookie not found. You need to see Shopify development team upgraded app bridge from 3x to 4.2.x to remove 3’rd party cookie dependency via JWT session token.
To fix the problem you ran into, my former solution was to check cookie and add again if cookie not found, please see code segment in the below.