Sentry Answers>JavaScript>

Failed to load response data: No data found for resource with given identifier

Failed to load response data: No data found for resource with given identifier

Matthew C.

The Problem

When using browser dev tools, like Chrome DevTools, to investigate why a fetch request has failed, you may see the following error in the Network tab on the browser dev tools response panel:

Click to Copy
Failed to load response data: No data found for resource with given identifier

This can be caused by cross-origin resource sharing (CORS), if your frontend code and the API endpoint are served from different origins and you haven’t set up CORS correctly.

It can also be caused by an incorrect request URL or a connection issue with the server.

The Solution

If the issue is caused by cross-origin resource sharing (CORS), you’ll see the following error in your browser dev tools Console tab:

Click to Copy
Access to fetch at 'http://localhost:1338/api/sync' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

The CORS header ‘Access-Control-Allow-Origin’ missing error indicates that you need to set up CORS on your server to allow your frontend to access your backend API resources. Add your frontend origin (URL) to the Access-Control-Allow-Origin header. In an Express app, you can install the CORS npm package and add an origin, as shown in the code below:

Click to Copy
import express from "express"; import cors from "cors"; const corsOptions = { origin: "http://localhost:5173" }; const app = express(); app.use(cors(corsOptions));

You can use an API development platform, such as Insomnia or Postman, to test whether the fetch request has a CORS issue. The same-origin policy is a browser security measure that restricts resource fetching from different origins. Insomnia and Postman don’t enforce CORS. To learn more, take a look at this Sentry answer: Why does my JavaScript code receive a “No Access-Control-Allow-Origin header is present on the requested resource” error, while Postman does not?.

If CORS isn’t the issue, make sure that your API route exists.

If the request URL is incorrect, or if there is a server connection issue, you’ll see a “Not Found” error in your browser dev tools Console tab:

Click to Copy
POST http://localhost:1338/api/syncc net::ERR_FAILED 404 (Not Found)

Note

You may only see the Failed to load response data: No data found for resource with given identifier error after multiple page reloads or page navigations if you’re using the Network tab in the dev tools of a Chromium browser and have the preserve log feature enabled. There is a Chromium issue about why some requests that initially show a response later show the error, after further page refreshes or navigation: DevTools: XHR (and other resources) content not available after navigation.

  • YoutubeHow Sentry.io saved me from disaster
  • ResourcesImprove Web Browser Performance - Find the JavaScript code causing slowdowns
  • SentryJavascript Error Monitoring & Tracing
  • ResourcesJavaScript Frontend Error Monitoring 101
  • Syntax.fmListen to the Syntax Podcast
  • Syntax.fm logo
    Listen to the Syntax Podcast

    Tasty treats for web developers brought to you by Sentry. Get tips and tricks from Wes Bos and Scott Tolinski.

    SEE EPISODES

Considered “not bad” by 4 million developers and more than 100,000 organizations worldwide, Sentry provides code-level observability to many of the world’s best-known companies like Disney, Peloton, Cloudflare, Eventbrite, Slack, Supercell, and Rockstar Games. Each month we process billions of exceptions from the most popular products on the internet.

© 2025 • Sentry is a registered Trademark of Functional Software, Inc.