When using the useAppBridge hook in my Shopify app, the idToken method does not behave as expected. The promise neither resolves with a token nor catches an error.
The promise from shopify.idToken() should resolve with a token, or catch an error if something goes wrong, but the promise does not resolve or reject. The console.log statements are never executed.
I’ve been running different tests based on the points you mention, and there are no problems.
In one of those tests I noticed that all the fetch requests made with the native Fetch API are not executed, when I open the devtools and check I don’t see any request being made when it should be. On the other hand, when I make them with axios they are executed.
In one of those tests I noticed that all the fetch requests made with the native Fetch API are not executed, when I open the devtools and check I don’t see any request being made when it should be. On the other hand, when I make them with axios they are executed.
That’s a clue.
Maybe there’s some other package or script on the page that is monkey patching the browser fetch.
There might be a way to tell in the Sources tab in Chrome if there’s a script adding to the fetch call.