I came across a weird bug when trying to create a new dev app with the shopify app bridge. When trying to hit my backend, the fetch request never completes. The issue seems to be when Shopify’s fetch override tries to retrieve the id token:
n.subscribe("SessionToken.respond", ( ({sessionToken: n}) => {
t(n)
}
What’s strange is that already existing stores work fine, and don’t seem to have any issues.
Steps to reproduce:
- Create a new store in dev portal
- Use
shopifycli to deploy setup for application_url or whatnot (I was using an existing apps config to ensure that the issue was new) - Load the app in the Shopify admin
- Requests to the backend using JS
fetchnever complete- Stepping through the debugger reveals that they hang at the code snippet above
I’m confident that this has to do with the app bridge fetch override, because disabling it by adding <meta name="shopify-disabled-features" content="fetch" /> to my index.html causes the requests to complete fine (though admittedly without any ID tokens, so this is not a usable workaround)
If relevant, the app handle is: seguno-bulk-daniel-public. We’re loading the App Bridge using Shopify’s CDN