We are developing a Shopify Embedded App. We are using Shopify Remix Template as base and so far we are enjoying it. But recently our QA report some issues which we cannot reproduce and therefore cannot find a solution.
The Back Story:
A new dev store and install the app. Use accept and install the app inside shopify admin. Then we call some API’s and based on those response we redirect the users to app dashboard or app setup wizard.
The Issue:
When this is done, sometimes the /app route throw unexpected server error and the app crashes. Only message we find is Unexpected Server Error. When this happens the user is not redirected to shopify-admin-url/apps/my-review-app/app rather it stucks at shopify-admin-url/appsmy-review-app and the page is totally BLANK
At first I thought may be hmac validation is failing. Then I opened the failed url in new tab and found it’s redirecting me to app dashboard as expected.
The Technical Aspects:
In our app.jsx we are calling Graphql API’s to get ShopInfo which is essential for our support chat and support chat component is also imported inside app.jsx files. [We are using crisp]
In our app._index.jsx file we call 4/5 API calls to retrieve dashboard data.
Users land on “/” route and then redirected to “/app” route. The “/app” route loads app._index.jsx file which is our dashboard.
The Other Issue:
Apart from this issue, we also noticed that the users are randomly shown “auth/login” page and after putting “shop.myshopify.com” they are redirected to the app’s page. How can we automate this thing? For Example: When user is unauthenticated from shopify we refresh the page so that shopify auto authenticate the user inside shopify admin.
We are stuck at these before our submission. Any insight will be helpful.
Response Headers when Unexpected Server Error Occurs[500 HTTP Code]
content-length 3207
content-type application/json; charset=utf-8
date Fri, 08 Aug 2025 05:29:42 GMT
server Apache/XYZ
vary Accept-Encoding
X-Firefox-Spdy h2
x-remix-response yes
And in my reponse body
<script>
window.__remixContext =
{"future":{"v3_fetcherPersist":false,
"v3_relativeSplatPath":false,
"v3_throwAbortReason":false,
"v3_routeConfig":false,
"v3_singleFetch":false,
"v3_lazyRouteDiscovery":false,
"unstable_optimizeDeps":false},
"state": {"loaderData": {"routes/app._index":
{ all data here is correct }
}
"root":null
},
"actionData":null,
"errors":{"root":{"message":"Unexpected Server Error","__type":"Error"}}
