HTML - Resolve "Cross-Origin Read Blocking (CORB) blocked cross-origin response"
by
Jeremy Canfield |
Updated: May 01 2023
| HTML articles
Let's say something like this being captured in the web browser console.
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://api2.amplitude.com/2/httpapi with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.
I once ran into this when submitting a request from web app "a" to web service "b". When I ran into this, the web server was a NodeJS app, and I had to update the NodeJS app to use CORS (Cross-origin resource sharing). I first had to use the npm install command to install the CORS module.
npm install cors
And then I updated the NodeJS app to import and use CORS.
import cors from 'cors';
app.use(cors());
Additionally, I also updated both web app "a" and web service "b" with header "Access-Control-Allow-Origin": "*".
headers: {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*"
}
Did you find this article helpful?
If so, consider buying me a coffee over at