Shopify App proxy returns html response not Json

I am developing a shopify app, and using theme app extension in it. When I am sending resquest to the app proxy url then It’s returning content-type (html/text) however we want content-type as application/json. Her you can see the code:

Here is the code from the app proxy file. whose name is, app.proxy.offer.jsx

import { authenticate } from "../shopify.server";
import db from "../db.server";
import { mapOfferToForm } from "../features/offers/mappers/offerToForm.mapper";

export async function loader({ request }) {
  try {
    await authenticate.public.appProxy(request);

    const url = new URL(request.url);
    const productId = url.searchParams.get("productId");

    if (!productId) {
      return new Response(
        JSON.stringify({
          success: false,
          error: "productId is required",
        }),
        {
          status: 400,
          headers: {
            "Content-Type": "application/json",
          },
        }
      );
    }

    const productGid = `gid://shopify/Product/${productId}`;

    console.log("=================================");
    console.log("FBT PROXY HIT");
    console.log("Product ID:", productId);
    console.log("Product GID:", productGid);

    const offer = await db.offer.findFirst({
      where: {
        baseProductId: productGid,
        status: true,
        deletedAt: null,
      },
      include: {
        products: true,
      },
    });

    console.log("Offer found:", offer);

    const responseData = {
      success: true,
      offer: offer ? mapOfferToForm(offer) : null,
    };

    return new Response(JSON.stringify(responseData), {
      status: 200,
      headers: {
        "Content-Type": "application/json",
      },
    });
  } catch (error) {
    console.error("FBT PROXY ERROR:", error);

    return new Response(
      JSON.stringify({
        success: false,
        error: error instanceof Error ? error.message : "Unknown error",
      }),
      {
        status: 500,
        headers: {
          "Content-Type": "application/json",
        },
      }
    );
  }
}

export default function Proxy() {
  return null;
}

and here is teh widget.js code:

document.addEventListener("DOMContentLoaded", async () => {
    console.log("FBT Widget Loaded");
  
    const widget = document.getElementById("fbt-widget");
  
    if (!widget) {
      console.error("FBT widget container not found");
      return;
    }
  
    // Temporary product ID for testing
    const productId = "7995961835595";
  
    // Shopify App Proxy endpoint
    const proxyUrl = `/apps/fbt-1/offer?productId=${productId}`;
  
    console.log("Fetching FBT offer from:", proxyUrl);
  
    try {
      const response = await fetch(proxyUrl);
  
      console.log("Response status:", response.status);
      console.log("Response content type:", response.headers.get("content-type"));
  
      if (!response.ok) {
        throw new Error(`HTTP error! Status: ${response.status}`);
      }
  
      const data = await response.json();
  
      console.log("JSON Response:", data);
  
      if (!data.success) {
        throw new Error(data.error || "Failed to load offer");
      }
  
      // No offer configured for this product
      if (!data.offer) {
        widget.innerHTML = `
          <div style="
            padding:20px;
            border:1px solid #ddd;
            margin-top:20px;
          ">
            <h2>Frequently Bought Together</h2>
            <p>No offer available for this product.</p>
          </div>
        `;
  
        return;
      }
  
      console.log("Offer:", data.offer);
  
      // For now, display the returned offer data
      widget.innerHTML = `
        <div style="
          padding:20px;
          border:1px solid #ddd;
          margin-top:20px;
        ">
          <h2>Frequently Bought Together</h2>
  
          <h3>
            ${data.offer.title || data.offer.name || "Special Offer"}
          </h3>
  
          <p>
            Offer loaded successfully ✅
          </p>
  
          <pre style="
            background:#f5f5f5;
            padding:10px;
            overflow:auto;
          ">${JSON.stringify(data.offer, null, 2)}</pre>
        </div>
      `;
  
    } catch (error) {
      console.error("FBT Widget Error:", error);
  
      widget.innerHTML = `
        <div style="
          padding:20px;
          border:1px solid #f00;
          margin-top:20px;
        ">
          <h2>Frequently Bought Together</h2>
          <p>Unable to load offer.</p>
        </div>
      `;
    }
  });

If you need anything else, or any file code please ask, I appreciate any help.

Hey @Sachin_Yadav - thanks for sharing this. Your JSON response setup looks okay, but App proxy 5xx responses can have their body replaced with storefront HTML, which would explain the text/html response.

Could you confirm the response status and whether FBT PROXY ERROR appears in your server logs? If it’s a 500, fix the underlying exception or return a 200 with { success: false, error: "..." } so the widget can reliably parse the JSON.

If the route logs don’t appear, we should check that /apps/fbt-1/offer maps to /app/proxy/offer in your active app proxy configuration. Let me know what you find!

here, actual, proxy route was this: const proxyUrl = `/apps/aov/offer?productId=${productId}`;,

Now the Log of FBT error is this:

in my terminal after running the Shopify app, and refreshing the store product page:


20:54:06 │                 app_proxy │ │ Using URL: https://army-april-natural-situated.trycloudflare.com/app/proxy
20:54:06 │                 app_proxy │ │ Any changes to prefix and subpath will only apply to new installs
20:54:06 │                  app_home │ └ Using URL: https://army-april-natural-situated.trycloudflare.com
20:55:13 │              React Router │ [shopify-api/INFO] version 13.1.0, environment React Router
20:55:14 │              React Router │ [shopify-app/INFO] Authenticating admin request | {shop: latenight-xbcfkli8.myshopify.com}
20:55:14 │              React Router │ [shopify-app/INFO] Authenticating admin request | {shop: latenight-xbcfkli8.myshopify.com}
20:55:15 │              React Router │ {
20:55:15 │              React Router │   "extensions": {
20:55:15 │              React Router │     "cost": {
20:55:15 │              React Router │       "requestedQueryCost": 9,
20:55:15 │              React Router │       "actualQueryCost": 2,
20:55:15 │              React Router │       "throttleStatus": {
20:55:15 │              React Router │       }
20:55:15 │              React Router │     }
20:55:15 │              React Router │   },
20:55:15 │              React Router │   "headers": {
20:55:15 │              React Router │     "Alt-Svc": [
20:55:15 │              React Router │       "h3=\":443\"; ma=86400"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Cf-Cache-Status": [
20:55:15 │              React Router │       "DYNAMIC"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Cf-Ray": [
20:55:15 │              React Router │       "a2b0f8983faba7a0-DEL"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Connection": [
20:55:15 │              React Router │       "keep-alive"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Content-Encoding": [
20:55:15 │              React Router │       "gzip"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Content-Language": [
20:55:15 │              React Router │       "en"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Content-Security-Policy": [
20:55:15 │              React Router │       "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*;
block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob:
 https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.pci.shopifyinc.com
https://checkout.pci.shopifyinc.com/build/04ed4e1/card_fields.js https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com
https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com
https://v.shopify.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopif
y&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=a36bc457-55e7-4b21-a212-ebffdc7a5680-1786721114; report-to
shopify-csp"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Content-Type": [
20:55:15 │              React Router │       "application/json; charset=utf-8"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Date": [
20:55:15 │              React Router │       "Fri, 14 Aug 2026 15:25:15 GMT"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Nel": [
20:55:15 │              React Router │       "{\"report_to\":\"cf-nel\",\"success_fraction\":0.01,\"max_age\":604800}"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Referrer-Policy": [
20:55:15 │              React Router │       "origin-when-cross-origin"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Report-To": [
20:55:15 │              React Router │
"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=Q2zY5%2FPWQUQmYIo2xvl6n%2FYdihJFArFOu3gKCE%2F9Ch
0xHqXLUT0CMfBNxmJiBuIGNfCI5BxtnKOQA5dyxQzhYRun00lMpMHQ6ywslrAfU97%2F0VU%2BHxrXWYpzuSrPB9BZtAMqWMignjhbZT8VXKCo8HtO\"}]}"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Reporting-Endpoints": [
20:55:15 │              React Router │       "shopify-csp=\"/csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraph
ql&source%5Bsection%5D=admin_api&source%5Buuid%5D=a36bc457-55e7-4b21-a212-ebffdc7a5680-1786721114\""
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Server": [
20:55:15 │              React Router │       "cloudflare"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Server-Timing": [
20:55:15 │              React Router │       "processing;dur=58, verdict_flag_enabled;desc=\"count=9\";dur=0.71, graphql;desc=\"admin/query/other\",
_y;desc=\"e115896a-1281-44a5-8609-f25e875c5fb6\", _s;desc=\"9b131c87-f780-4e36-b22b-e57577070519\""
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Strict-Transport-Security": [
20:55:15 │              React Router │       "max-age=7889238"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Transfer-Encoding": [
20:55:15 │              React Router │       "chunked"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "Vary": [
20:55:15 │              React Router │       "Accept-Encoding,Sec-Fetch-Site"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Content-Type-Options": [
20:55:15 │              React Router │       "nosniff"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Dc": [
20:55:15 │              React Router │       "gcp-asia-southeast1,gcp-us-east1,gcp-us-east1"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Download-Options": [
20:55:15 │              React Router │       "noopen"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Frame-Options": [
20:55:15 │              React Router │       "DENY"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Permitted-Cross-Domain-Policies": [
20:55:15 │              React Router │       "none"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Request-Id": [
20:55:15 │              React Router │       "a36bc457-55e7-4b21-a212-ebffdc7a5680-1786721114"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Shopify-Api-Gql-Engine": [
20:55:15 │              React Router │       "cardinal"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Shopify-Api-Gql-Operation-Signature": [
20:55:15 │              React Router │       "65324fbf45c4a493def32ede94d68d7ef5fdc7dd29c129bb4438cd4d1fb327ee"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Shopify-Api-Version": [
20:55:15 │              React Router │       "2025-10"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Stats-Apiclientid": [
20:55:15 │              React Router │       "396158271489"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Stats-Apipermissionid": [
20:55:15 │              React Router │       "549503303755"
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Stats-Userid": [
20:55:15 │              React Router │       ""
20:55:15 │              React Router │     ],
20:55:15 │              React Router │     "X-Xss-Protection": [
20:55:15 │              React Router │       "1; mode=block"
20:55:15 │              React Router │     ]
20:55:15 │              React Router │   }
20:55:15 │              React Router │ }
20:56:29 │              React Router │ [shopify-app/INFO] Authenticating admin request | {shop: latenight-xbcfkli8.myshopify.com}
20:56:29 │              React Router │ [shopify-app/INFO] Authenticating admin request | {shop: latenight-xbcfkli8.myshopify.com}
20:56:29 │              React Router │ {
20:56:29 │              React Router │   "data": {
20:56:29 │              React Router │     "shopifyFunctions": {
20:56:29 │              React Router │       "nodes": [
20:56:29 │              React Router │         {
20:56:29 │              React Router │           "id": "01a000df-884d-7778-a7e9-21bb27f16404",
20:56:29 │              React Router │           "title": "fbt-discount",
20:56:29 │              React Router │           "apiType": "discount"
20:56:29 │              React Router │         }
20:56:29 │              React Router │       ]
20:56:29 │              React Router │     }
20:56:29 │              React Router │   },
20:56:29 │              React Router │   "extensions": {
20:56:29 │              React Router │     "cost": {
20:56:29 │              React Router │       "requestedQueryCost": 9,
20:56:29 │              React Router │       "actualQueryCost": 2,
20:56:29 │              React Router │       "throttleStatus": {
20:56:29 │              React Router │         "maximumAvailable": 2000,
20:56:29 │              React Router │         "currentlyAvailable": 1998,
20:56:29 │              React Router │         "restoreRate": 100
20:56:29 │              React Router │       }
20:56:29 │              React Router │     }
20:56:29 │              React Router │   },
20:56:29 │              React Router │   "headers": {
20:56:29 │              React Router │     "Alt-Svc": [
20:56:29 │              React Router │       "h3=\":443\"; ma=86400"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Cf-Cache-Status": [
20:56:29 │              React Router │       "DYNAMIC"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Cf-Ray": [
20:56:29 │              React Router │       "a2b0fa6a2810a857-DEL"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Connection": [
20:56:29 │              React Router │       "keep-alive"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Content-Encoding": [
20:56:29 │              React Router │       "gzip"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Content-Language": [
20:56:29 │              React Router │       "en"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Content-Security-Policy": [
20:56:29 │              React Router │       "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*;
block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob:
 https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.pci.shopifyinc.com
https://checkout.pci.shopifyinc.com/build/04ed4e1/card_fields.js https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com
https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com
https://v.shopify.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopif
y&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=e5d4fc02-51d7-40fa-bde7-105c6297612b-1786721189; report-to
shopify-csp"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Content-Type": [
20:56:29 │              React Router │       "application/json; charset=utf-8"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Date": [
20:56:29 │              React Router │       "Fri, 14 Aug 2026 15:26:29 GMT"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Nel": [
20:56:29 │              React Router │       "{\"report_to\":\"cf-nel\",\"success_fraction\":0.01,\"max_age\":604800}"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Referrer-Policy": [
20:56:29 │              React Router │       "origin-when-cross-origin"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Report-To": [
20:56:29 │              React Router │
"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=johDLv32Gyy1ObNlCZ5FJihJ7zd1cTZ7Me5T%2F2qWUdWMHW
qBlpLUh3JgahRVE05ghZq%2FVPTxqyi5ldQyO%2FqQOwrw9vBC31hl%2BMPkv6ik3s7vDsyM1OZixV2qs0j58L9upotlTqIgR6wKG%2Ffp2N9hIVBH\"}]}"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Reporting-Endpoints": [
20:56:29 │              React Router │       "shopify-csp=\"/csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraph
ql&source%5Bsection%5D=admin_api&source%5Buuid%5D=e5d4fc02-51d7-40fa-bde7-105c6297612b-1786721189\""
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Server": [
20:56:29 │              React Router │       "cloudflare"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Server-Timing": [
20:56:29 │              React Router │       "processing;dur=43, verdict_flag_enabled;desc=\"count=9\";dur=0.54, graphql;desc=\"admin/query/other\",
_y;desc=\"599ca581-8038-426d-a4e9-e07d86b585e1\", _s;desc=\"0507ca1a-89de-42a4-a76d-2ccb17ca57ec\""
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Strict-Transport-Security": [
20:56:29 │              React Router │       "max-age=7889238"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Transfer-Encoding": [
20:56:29 │              React Router │       "chunked"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "Vary": [
20:56:29 │              React Router │       "Accept-Encoding,Sec-Fetch-Site"
20:56:29 │              React Router │     ],Policies": [
20:56:29 │              React Router │       "none"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "X-Request-Id": [
20:56:29 │              React Router │       "e5d4fc02-51d7-40fa-bde7-105c6297612b-1786721189"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "X-Shopify-Api-Gql-Engine": [
20:56:29 │              React Router │       "cardinal"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "X-Shopify-Api-Gql-Operation-Signature": [
20:56:29 │              React Router │       "65324fbf45c4a493def32ede94d68d7ef5fdc7dd29c129bb4438cd4d1fb327ee"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "X-Shopify-Api-Version": [
20:56:29 │              React Router │       "2025-10"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "X-Stats-Apiclientid": [
20:56:29 │              React Router │       "396158271489"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "X-Stats-Apipermissionid": [
20:56:29 │              React Router │       "549503303755"
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "X-Stats-Userid": [
20:56:29 │              React Router │       ""
20:56:29 │              React Router │     ],
20:56:29 │              React Router │     "X-Xss-Protection": [
20:56:29 │              React Router │       "1; mode=block"
20:56:29 │              React Router │     ]
20:56:29 │              React Router │   }
20:56:29 │              React Router │ }
20:56:31 │              React Router │ [shopify-app/INFO] Authenticating admin request | {shop: latenight-xbcfkli8.myshopify.com}
20:56:31 │              React Router │ [shopify-app/INFO] Authenticating admin request | {shop: latenight-xbcfkli8.myshopify.com}
20:56:31 │              React Router │ {
20:56:31 │              React Router │   "data": {
20:56:31 │              React Router │     "shopifyFunctions": {
20:56:31 │              React Router │       "nodes": [
20:56:31 │              React Router │         {
20:56:31 │              React Router │           "id": "01a000df-884d-7778-a7e9-21bb27f16404",
20:56:31 │              React Router │           "title": "fbt-discount",
20:56:31 │              React Router │           "apiType": "discount"
20:56:31 │              React Router │         }
20:56:31 │              React Router │       ]
20:56:31 │              React Router │     }
20:56:31 │              React Router │   },
e
20:56:31 │              React Router │   "headers": {
20:56:31 │              React Router │     "Alt-Svc": [
20:56:31 │              React Router │       "h3=\":443\"; ma=86400"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Cf-Cache-Status": [
20:56:31 │              React Router │       "DYNAMIC"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Cf-Ray": [
20:56:31 │              React Router │       "a2b0fa7588b4a857-DEL"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Connection": [
20:56:31 │              React Router │       "keep-alive"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Content-Encoding": [
20:56:31 │              React Router │       "gzip"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Content-Language": [
20:56:31 │              React Router │       "en"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Content-Security-Policy": [
20:56:31 │              React Router │       "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*;
block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob:
 https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.pci.shopifyinc.com
https://checkout.pci.shopifyinc.com/build/04ed4e1/card_fields.js https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com
https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com
https://v.shopify.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopif
y&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=703f1ef4-a358-483f-b22b-8217c00934e1-1786721191; report-to
shopify-csp"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Content-Type": [
20:56:31 │              React Router │       "application/json; charset=utf-8"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Date": [
20:56:31 │              React Router │       "Fri, 14 Aug 2026 15:26:31 GMT"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Nel": [
20:56:31 │              React Router │       "{\"report_to\":\"cf-nel\",\"success_fraction\":0.01,\"max_age\":604800}"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Referrer-Policy": [
20:56:31 │              React Router │       "origin-when-cross-origin"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Report-To": [
20:56:31 │              React Router │
"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=%2BJGGY0DW6NMHH3xRpWquDbS5%2FmbH7aLHl9YrBoyyfXT7
%2B9AIJkbXUmdzsP6Uc7co4R3YMnghcJ9%2Fu2kr%2FLUSnXrUmU43qNLo%2FtDiKyMshSqMGw1auKq27OkEcdMEaibBnGTdpJijfgpPmIijvtx%2BpnzM\"}]}"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Reporting-Endpoints": [
20:56:31 │              React Router │       "shopify-csp=\"/csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraph
ql&source%5Bsection%5D=admin_api&source%5Buuid%5D=703f1ef4-a358-483f-b22b-8217c00934e1-1786721191\""
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Server": [
20:56:31 │              React Router │       "cloudflare"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Server-Timing": [
20:56:31 │              React Router │       "processing;dur=41, verdict_flag_enabled;desc=\"count=10\";dur=0.512, graphql;desc=\"admin/query/other\",
_y;desc=\"e16ec0bb-d16f-4e6a-9ac4-a6a1fad6a1b0\", _s;desc=\"39d16fd5-ebff-4143-a565-8b0b203f0a45\""
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Strict-Transport-Security": [
20:56:31 │              React Router │       "max-age=7889238"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Transfer-Encoding": [
20:56:31 │              React Router │       "chunked"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "Vary": [
20:56:31 │              React Router │       "Accept-Encoding,Sec-Fetch-Site"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Content-Type-Options": [
20:56:31 │              React Router │       "nosniff"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Dc": [
20:56:31 │              React Router │       "gcp-asia-southeast1,gcp-us-east1,gcp-us-east1"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Download-Options": [
20:56:31 │              React Router │       "noopen"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Frame-Options": [
20:56:31 │              React Router │       "DENY"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Permitted-Cross-Domain-Policies": [
20:56:31 │              React Router │       "none"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Request-Id": [
20:56:31 │              React Router │       "703f1ef4-a358-483f-b22b-8217c00934e1-1786721191"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Shopify-Api-Gql-Engine": [
20:56:31 │              React Router │       "cardinal"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Shopify-Api-Gql-Operation-Signature": [
20:56:31 │              React Router │       "65324fbf45c4a493def32ede94d68d7ef5fdc7dd29c129bb4438cd4d1fb327ee"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Shopify-Api-Version": [
20:56:31 │              React Router │       "2025-10"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Stats-Apiclientid": [
20:56:31 │              React Router │       "396158271489"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Stats-Apipermissionid": [
20:56:31 │              React Router │       "549503303755"
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Stats-Userid": [
20:56:31 │              React Router │       ""
20:56:31 │              React Router │     ],
20:56:31 │              React Router │     "X-Xss-Protection": [
20:56:31 │              React Router │       "1; mode=block"
20:56:31 │              React Router │     ]
20:56:31 │              React Router │   }
20:56:31 │              React Router │ }
20:56:34 │              React Router │ [shopify-app/INFO] Authenticating admin request | {shop: null}
20:57:39 │              React Router │ [shopify-app/INFO] Authenticating app proxy request | {shop: latenight-xbcfkli8.myshopify.com}
20:57:39 │              React Router │ =================================
20:57:39 │              React Router │ FBT PROXY HIT
20:57:39 │              React Router │ Product ID: 7995961835595
20:57:39 │              React Router │ Product GID: gid://shopify/Product/7995961835595
20:57:39 │              React Router │ Offer found: {
20:57:39 │              React Router │   id: 'cmrkotr780000lmkfrspxnjp4',
20:57:39 │              React Router │   shop: 'latenight-xbcfkli8.myshopify.com',
20:57:39 │              React Router │   title: 'You are feeling really Great',
20:57:39 │              React Router │   handle: null,
20:57:39 │              React Router │   status: true,18T05:42:49.775Z,
20:57:39 │              React Router │   deletedAt: null,
20:57:39 │              React Router │   shopifyDiscountId: 'gid://shopify/DiscountAutomaticNode/1488727736395',
20:57:39 │              React Router │   shopifyFunctionId: null,
20:57:39 │              React Router │   baseProductId: 'gid://shopify/Product/7995961835595',
20:57:39 │              React Router │   baseVariantId: 'gid://shopify/ProductVariant/42887210991691',
20:57:39 │              React Router │   baseProductTitle: 'The 3p Fulfilled Snowboard',
20:57:39 │              React Router │   baseProductImage:
'https://cdn.shopify.com/s/files/1/0677/8591/6491/files/Main_b9e0da7f-db89-4d41-83f0-7f417b02831d.jpg?v=1783744744',
20:57:39 │              React Router │   baseProductPrice: '2629.95',
20:57:39 │              React Router │   widgetEnabled: true,
20:57:39 │              React Router │   discountValue: 12,
20:57:39 │              React Router │   views: 0,
20:57:39 │              React Router │   clicks: 0,
20:57:39 │              React Router │   conversions: 0,
20:57:39 │              React Router │   revenue: 0,
20:57:39 │              React Router │   products: [
20:57:39 │              React Router │     {
20:57:39 │              React Router │       id: 'cmrpxxapj0000lmhy792up0pt',
20:57:39 │              React Router │       offerId: 'cmrkotr780000lmkfrspxnjp4',
20:57:39 │              React Router │       productId: 'gid://shopify/Product/7995961901131',
20:57:39 │              React Router │       variantId: 'gid://shopify/ProductVariant/42887211024459',
20:57:39 │              React Router │       productHandle: 'the-collection-snowboard-oxygen',
20:57:39 │              React Router │       productTitle: 'The Collection Snowboard: Oxygen',
20:57:39 │              React Router │       productImage:
'https://cdn.shopify.com/s/files/1/0677/8591/6491/files/Main_d624f226-0a89-4fe1-b333-0d1548b43c06.jpg?v=1783744744',
20:57:39 │              React Router │       productPrice: '1025.00',
20:57:39 │              React Router │       compareAtPrice: null,
20:57:39 │              React Router │       position: 1
20:57:39 │              React Router │     }
20:57:39 │              React Router │   ]
20:57:39 │              React Router │ }
20:57:45 │              React Router │ [shopify-app/INFO] Authenticating app proxy request | {shop: latenight-xbcfkli8.myshopify.com}
20:57:45 │              React Router │ =================================
20:57:45 │              React Router │ FBT PROXY HIT
20:57:45 │              React Router │ Product ID: 7995961835595
20:57:45 │              React Router │ Product GID: gid://shopify/Product/7995961835595
20:57:45 │              React Router │ Offer found: {
20:57:45 │              React Router │   id: 'cmrkotr780000lmkfrspxnjp4',
20:57:45 │              React Router │   shop: 'latenight-xbcfkli8.myshopify.com',
20:57:45 │              React Router │   title: 'You are feeling really Great',
20:57:45 │              React Router │   handle: null,
20:57:45 │              React Router │   status: true,
20:57:45 │              React Router │   syncStatus: 'ACTIVE',
20:57:45 │              React Router │   lastSyncedAt: 2026-07-18T05:42:49.775Z,
20:57:45 │              React Router │   deletedAt: null,
20:57:45 │              React Router │   shopifyDiscountId: 'gid://shopify/DiscountAutomaticNode/1488727736395',
20:57:45 │              React Router │   shopifyFunctionId: null,
20:57:45 │              React Router │   baseProductId: 'gid://shopify/Product/7995961835595',
20:57:45 │              React Router │   baseVariantId: 'gid://shopify/ProductVariant/42887210991691',
20:57:45 │              React Router │   baseProductTitle: 'The 3p Fulfilled Snowboard',
20:57:45 │              React Router │   baseProductImage:
'https://cdn.shopify.com/s/files/1/0677/8591/6491/files/Main_b9e0da7f-db89-4d41-83f0-7f417b02831d.jpg?v=1783744744',
20:57:45 │              React Router │   baseProductPrice: '2629.
20:57:45 │              React Router │     {
20:57:45 │              React Router │       id: 'cmrpxxapj0000lmhy792up0pt',
20:57:45 │              React Router │       offerId: 
20:57:45 │              React Router │       productPrice: '1025.00',
20:57:45 │              React Router │       compareAtPrice: null,
20:57:45 │              React Router │       position: 1
20:57:45 │              React Router │     }
20:57:45 │              React Router │   ]
20:57:45 │              React Router │ }

───────────────────────────────────────────────────────────────────────────────────────────

I uploaded whole terminal output so that if any part is of any help than it shouldn’t be left out.

Because of the whole terminal response is above 3200 I tried data related part from the terminal log.

The FBT error appeared but in the console of the Browser:

here:

[HotReload] CLI hot reload disabled - No hot reload port specified.
widget.js:2 FBT Widget Loaded
widget.js:17 Fetching FBT offer from: /apps/aov/offer?productId=7995961835595
widget.js:22 Response status: 200
widget.js:23 Response content type: text/html
widget.js:81 FBT Widget Error: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
(anonymous) @ widget.js:81
[NEW] Explain Console errors by using Copilot in Edge: click  to explain an error. Learn more

FBT Widget Error: SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "… is not valid JSON
(anonymous) @ widget.js:81 this is the main error I am facing

Thanks for providing those logs @Sachin_Yadav , this narrows it down for me, really appreciated! The proxy route is being reached successfully, but this default export makes React Router treat it as a document route and render HTML:

export default function Proxy() {
  return null;
}

I would remove that block and leave only the loader. That makes it a resource route, allowing the JSON response to pass through directly.

React Router documents this convention here: Resource Routes | React Router

Let me know if you’re still seeing text/html after making that change!

Thank you very much, It started working.