I’m running into a problem with my Shopify app. Last week everything was working perfectly, but today I can’t make any network requests from my store, only when deployed.
Some details:
-
Both my frontend and backend are deployed to Fly.io.
-
Locally, everything works fine.
-
When I try to make a network request to my Node backend from my local store, nothing happens.
-
I still see console logs up until the point of the request.
-
On the backend, I don’t see any logs for that route.
Here’s the function I’m using to make the request:
const fetchAppStatus = async () => {
setLoading(true);
try {
const response = await fetch("/api/app-status");
if (!response.ok) throw new Error("Failed to fetch app status");
const data = await response.json();
} catch (err) {
showToast(`Error fetching status: ${err.message}`, true);
} finally {
setLoading(false);
}
};
Hi @Alija_Fajic
When deployed, if your frontend and backend are on different domains or subdomains, /api/app-status will try to hit the frontend’s domain, not the backend. You’ll want to use an absolute URL or set up a reverse proxy so that /api/app-status routes correctly in production.
Hi @Liam-Shopify,
Thank you for your response. That is not the problem, I have also tried with the absolute URL, although my frontend and backend are on the same domain.
I got a suggestion to try this function in the Google console and to execute it there. In the browser, I got this error:
host-B3PrGjK7WOZy.js:18 GET https://myapp.fly.dev/api/auth?shop=undefined 500 (Internal Server Error)
And on the backend I see this:
[shopify-api/ERROR] Missing Authorization header, was the request made with authenticatedFetch? | {isOnline: false}
Session was not valid. Redirecting to /api/auth?shop=undefined | {shop: undefined}
GET /api/carrier-services?shop=myStore 302 1.208 ms
OPTIONS /api/auth?shop=undefined 204 0.147 ms - shop=undefined
No shop provided to redirect to auth
But probably this is happening because in the console, “shop” doesn’t exist.
When i open my application on the Shopify, api for status is called, and on the backend, I only see these logs.
2025-11-26T08:50:32Z app[7816dd0be12528] arn [info]GET /?embedded=1&hmac=fdb1209af9b9cd72906ab&host=YWRtc3RvcmUvbG9ndHJhZGUtdGVzdC1zdG9yZS0y&id_token=oSr4vift9qcRga0&locale=en&session=aab6b1b31726f4fcbec354074784c5237c2f1&shop=myShop.myshopify.com×tamp=1764147032 200 26.074 ms - shop=myShop.myshopify.com - These are not real values, I edited them
2025-11-26T08:50:32Z app[7816dd0be12528] arn [info]GET /assets/index-DZDU4ZvY.js 200 0.971 ms - shop=-
2025-11-26T08:50:32Z app[2867d55b6e39e8] arn [info]GET /assets/index-DbpU1vhr.css 200 1.009 ms - shop=-
2025-11-26T08:50:32Z app[7816dd0be12528] arn [info]GET /assets/en-C5k7Hynn.js 200 0.847 ms - shop=-
2025-11-26T08:50:32Z app[2867d55b6e39e8] arn [info]GET /assets/en-BQD6kysk.js 200 1.242 ms - shop=-
I have created a test endpoint without authentication/authorization
router.get(“/test”, (req, res) => {
res.status(200).send(“Test endpoint is working!”);
});
When I test it from Postman, I get the result.
But when I try from my Admin app:
const testFetch = async () => {
try {
console.log("Testing fetch to backend");
const response = await fetchWithAuth(`/api/test`);
console.log("Test fetch response:", response);
const data = await response.json();
console.log("Test fetch data:", data);
} catch (error) {
console.error("Test fetch error:", error);
}
};
I have also tried with the full URL → `${BACKEND_BASE_URL}/api/test`
But it is same for both cases. I can’t see the network req in the network tab and in the console I see just this: Testing fetch to backend and nothing more.
When i execute this function from the Google chrome console with absolute URL I got the response.