spooky particles

Tells your coding agent when an app you shipped breaks.Spooky Particles

When server errors like this rise, Spooky tells your coding agent, if it can read the project's request history on Vercel.

Vercel INFINITE_LOOP_DETECTED: what the 508 means and what to change

INFINITE_LOOP_DETECTED is a 508 Loop Detected error from Vercel. It means Vercel detected an infinite loop in the app, such as endless requests to itself or to an outside API or database. Find the redirect, rewrite or fetch that repeats without end, break it, and redeploy.

Why does Vercel say a loop was detected?

Vercel's INFINITE_LOOP_DETECTED page lists the error as 508. It says the error occurs when an infinite loop is detected in the application. That can be the app making endless requests to itself, or endless requests to an external API or a database.

A common shape is a rule that sends a path to the same path, such as a redirect with no condition. Vercel's own list names an unconditional redirect and a looping fetch as the first things to look for.

How do I fix it?

Work through the checks on Vercel's page:

  1. Check the application's source code. Look for code that can loop, such as a fetch that calls itself or a redirect with no condition.
  2. Check the configuration. Vercel says to review files such as next.config.js and vercel.json, in case a redirect or rewrite there sends a request back to where it started.
  3. Review external API and database calls. Make sure the calls your app makes do not error or loop.
  4. Handle unhandled exceptions. Read the application logs for an unhandled exception that could be feeding the loop.
  5. Check Vercel's status page. If the steps above find nothing, Vercel says a reported outage in its CDN can sometimes cause this error.

Test one change at a time. After each change, request the same address again and see whether the 508 is gone before you change anything else.

What can I paste into my coding agent?

text
My Vercel site returns 508 INFINITE_LOOP_DETECTED. Read https://vercel.com/docs/errors/INFINITE_LOOP_DETECTED and list which of its checks apply to this project: source code, next.config.js and vercel.json redirects or rewrites, external API or database calls, unhandled exceptions. Look only at files in this repo. Do not change any settings or redeploy. Show me any rule that sends a path back to itself, and tell me which checks I must do myself in the Vercel dashboard.

Related

A loop is a different problem from a missing page: see Vercel 404 NOT_FOUND or Vercel DEPLOYMENT_NOT_FOUND. If the site answers 502, see Vercel 502 Bad Gateway. The Vercel deployment errors list covers other codes, Automate fixes explains the coding-agent workflow, VibeOps covers keeping shipped apps running, and the quickstart for coding agents shows how to set up alerts.