¿Mercado Pago no se carga? Problemas de conexión, timeouts o errores 5xx impiden el acceso. Descubre la solución inmediata.
El error ‘Mercado Pago no carga’ suele ser causado por problemas en la infraestructura de Mercado Pago, como timeouts HTTP (504 Gateway Timeout) al intentar comunicarse con sus servidores. También puede deberse a problemas de red en tu dispositivo o conexión a internet, generando errores 502 Bad Gateway.
// Retry con backoff exponencial frente a 5xx / timeouts
async function callMercadoPago(path, init = {}, attempts = 4) {
for (let i = 0; i < attempts; i++) {
try {
const r = await fetch(`https://api.mercadopago.com${path}`, {
...init,
headers: {
Authorization: `Bearer ${process.env.MP_ACCESS_TOKEN}`,
'X-Idempotency-Key': init.idempotencyKey,
...init.headers,
},
signal: AbortSignal.timeout(15000),
});
if (r.status >= 500 || r.status === 429) throw new Error(`MP ${r.status}`);
return await r.json();
} catch (err) {
if (i === attempts - 1) throw err;
await new Promise(res => setTimeout(res, 2 ** i * 1000));
}
}
}
Comorando intercepta cada evento de Mercado Pago, ejecuta reintentos inteligentes y te avisa cuando hay un problema — sin que escribas una sola línea de código extra.
Automatizá tus pagos gratis →Sin tarjeta de crédito · 250 eventos gratis · En vivo en 5 minutos