Shopify App Bridge issue - missing host query

Hi @Shopify_77 Team,

I have developed app using Shopify CLI and react, App usually works fine but occasionally it returns error of Missing host, So far I have observed there are 2 scenarios when this error arise which are below:

  1. Sometimes on page load this error shows up.

  2. If we keep any app page idle for long time then this error shows on that page.

From what other Shopify community topics and comments it seems this have to do something with APP BRIDGE library but I am not sure so can anyone please help me to understand and fix this issue

Please see screenshot attached of the error, Any help will be much appreciated.

Hello @pankajlehar

This issue occurs locally because we are making changes on the local environment, and it may not have loaded correctly, which could be causing the issue.

However, this issue does not appear in the live app. Since it’s related to the session, it will only occur locally. If this issue arises in the live environment, it would be related to the Node session.

If the solution presented meets your needs and addresses your query effectively, I encourage you to accept it as the chosen answer. This will acknowledge the support you received and aid fellow community members in identifying reliable and effective solutions for their similar concerns.
Thank you.
(GD)

Actually this issue of missing host query also occurs in our live app.

The missing host query error comes once in a while when we keep any app page idle for a long time. We are not sure why this error is occured. Is this from the app bridge or something else.