TypeError: Failed to fetch
This message shows up in 5 different situations. Pick the one that matches yours:
- Exchange Online Admin API (the REST behind EXO V3) cannot be called from the browser — no CORS, and SPFx tokens lack Exchange.Manageadminapi/beta/{tenant}/InvokeCommand fails with 'Failed to fetch' even with a fake token; read Exchange config with an admin-run script and import, or use Graph message trace and mailbox reportsCause and fix →
- A network drop through the Microsoft Graph JS client looks like an HTTP error with status -1msgraph client wraps a failed fetch as GraphError statusCode -1, code TypeError – detect it, don't report "permission denied"Cause and fix →
- DecompressionStream throws away the whole result when bytes follow the compressed dataInflating a PDF FlateDecode stream in the browser fails completely because a line break sits between the data and endstream; trim trailing CR/LF and read chunk by chunk, keeping what arrived before the errorCause and fix →
- An SPFx web part that calls an intranet API makes Chrome and Edge ask every user for local network accessA *.sharepoint.com page fetching a host that resolves to a private IP is a local network request – Chrome (from 142) and Edge prompt every user and a refusal is a bare Failed to fetch; pre-allow the SharePoint origin by policy and still plan for CORS, trusted HTTPS, VPN-only reach and per-user tokens – or let a connector inside the network write to a list through Sites.SelectedCause and fix →
- Getting bulk data into a SharePoint page from the console — a localhost server beats pasting, and beats uploading it somewhereServe the payload from 127.0.0.1 with CORS instead of pasting it or uploading it; loopback is a trustworthy origin so HTTPS pages may fetch it – and when Chrome local network access blocks it ("Failed to fetch"), feed the files through a file inputCause and fix →