ExitIframe is Executing Too Early in Shopify App Bridge (CDN Integration)

I’m developing a Shopify app using App Bridge via CDN and implementing ExitIframe. However, the iframe is closing too early, before the app is fully loaded. It seems like ExitIframe is running before the App Bridge is fully initialized.