Short answer
Open the browser’s Network tab and console: a CORS message there means the API must send Access-Control-Allow-Origin for your site. If your page is on HTTPS and the API URL starts with http://, the browser blocks it as mixed content: use HTTPS for the API. On a phone or emulator, localhost is the device itself, so use your computer’s LAN address (or 10.0.2.2 on the Android emulator) and allow cleartext only for development. Also check the API URL and that the server is running and reachable.
Rather not fix it yourself? App Fix Ticket fixes one reproducible bug at a fixed price, with an optional Diagnosis that is credited toward the fix.
Why there is no response, and the fix
01
CORS blocked the response
“The request was made but no response was received” Axios, Handling errors
The most common cause in the browser. The server answered, but without the CORS headers for your origin, so the browser hides the response and Axios only sees a network error. The console shows the real CORS message. Fix it on the server, not in the Axios call.
// Express API import cors from 'cors'; app.use(cors({ origin: ['https://app.example.com'] }));02
An http:// API from an https:// page
“Mixed content requests are insecure requests for resources from a secure context” MDN, Mixed content: examples
A site served over HTTPS cannot call an http:// API: browsers block it as mixed content. It works locally, because browsers treat http://localhost as secure, and fails once deployed. Put the API behind HTTPS and update the base URL.
const api = axios.create({ baseURL: 'https://api.example.com', // not http:// });03
localhost from a phone, emulator or container
In React Native, Expo or Docker, localhost means the device or container itself, not your computer. Use your computer’s LAN IP address, 10.0.2.2 on the Android emulator, or the service name in Docker Compose. Android blocks plain http:// by default and iOS App Transport Security does too, so use HTTPS or allow cleartext for development builds only.
// Android emulator const api = axios.create({ baseURL: 'http://10.0.2.2:3000' });04
Tell network errors apart from HTTP errors
When the server answers with 4xx or 5xx, Axios fills error.response. Only when there is no response at all do you get Network Error. Log both cases separately so the next failure points at the right cause.
try { await api.get('/me'); } catch (err) { if (err.response) console.error('HTTP', err.response.status, err.response.data); else if (err.request) console.error('No response:', err.code, err.config?.url); else console.error('Setup error:', err.message); }
Checked against the vendor’s docs on : Axios docs: Handling errors; MDN: Mixed content.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug. The Fix costs $1,200. If you need a Diagnosis first, its $450 fee counts toward the Fix.See scope and start
- from $450AI-Built App RescueFor a whole-app review, the $450 Launch Check is credited toward the optional $1,950 Rescue Sprint for up to five critical or high findings.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
Related: “Blocked by CORS policy” · “TypeError: Failed to fetch” · ECONNREFUSED: connection refused