The course
Opaque responses
When a cross-origin fetch() uses mode: "no-cors",
the browser still sends the request and the server still processes it —
but the Response your JavaScript sees is deliberately
gutted. Its type is "opaque":
status is 0, no headers are readable, and the
body is unreachable. This happens even when the request would otherwise
have succeeded.
"Just add no-cors" is a common, wrong response to a CORS
error — it looks like it worked (the Network tab shows a real response),
but your code gets nothing. The demo below runs the same failing request
in both modes side by side, so you can see exactly what the browser
hides from your JavaScript.
Press Run both demos to fire two real cross-origin requests — one with the default cors mode, one with no-cors — and see how the browser treats each.