TL;DR: My embedded Remix app was flagged under BFS 4.1.1 two times for “the page flashes a different page before displaying the actual page” on reload. The Shopify reviewer captured it on a screencast, but I cannot reproduce it on any of my own test stores or browsers. Looking for help identifying what causes this on a cold/first session and how to eliminate it.
Screencast from the reviewer: https://screenshot.click/28-55-40371-29635.webm
What the screencast actually shows
Looking closely, it’s not a different route/page of my app — it’s a brief flash of a bare, unstyled HTML page (no Polaris styling, essentially blank/raw) that appears for a fraction of a second, then resolves to the correct, fully-styled page. So the symptom is “flash of unstyled/blank HTML → styled app,” not “Page A → Page B.” It only happens on a cold session (fresh install / first load); on my own installs it never appears, presumably because my session and the App Bridge script are already warm/cached.
My understanding of the cause
I traced it to the App Bridge bootstrap in @shopify/shopify-app-remix. On a cold document load, authenticate.admin() renders a minimal bootstrap document — essentially:
<script data-api-key="..." src="https://cdn.shopify.com/shopifycloud/app-bridge.js"></script>
<script>window.open("<destination>", "_top")</script>
That bare page loads App Bridge, then redirects to the real styled route. Warm session = instant/invisible; cold session = the bare page lingers long enough to read as a flash. I believe this is the “purely HTML” flash.
Stack
@shopify/shopify-app-remix ^3.7.0,@shopify/app-bridge-react ^4.1.6,@shopify/polaris ^12.27.0, Remix^2.16.1, React^18.2.0- Embedded, token exchange (
unstable_newEmbeddedAuthStrategy: true), API2025-01, Fly.io application_url= domain root;/redirects to/apppreserving all query params; App Bridge provided viaAppProviderin the body (not<head>).
What I’ve tried
- Removed all
defer()/Suspense/Awaitstreaming — every loaderawaits and returnsjson(). - No leftover boilerplate routes.
- Can’t reproduce on any browser/store, even throttled.
Questions
-
Is this cold-session App Bridge bootstrap flash something apps must eliminate for BFS 4.1.1, and how?
-
Does the extra
/→/appredirect hop worsen it? Shouldapplication_urlpoint directly at/app? -
Is moving
app-bridge.jsinto the<head>the correct fix, or does the bootstrap bounce fromauthenticate.adminhappen before the head script can help? -
Has anyone passed this exact 4.1.1 flag on embedded Remix + App Bridge v4, what fixed it?
Kind regards,
Tri