# `TypeError: Failed to fetch`

**Where it appears:** Browser console

**What it means:** The browser tried to talk to your server or an external address and couldn't reach it at all.

## Likely causes

- Your local dev server (`npm run dev`) stopped running or crashed in the terminal.
- The code calls a wrong URL or tries to call an external API directly from the browser instead of the server.

## Message for your agent

```text
The browser shows `TypeError: Failed to fetch`. Check that the dev server is running, inspect the server terminal for errors, and move any external API call to the server.
```

**Prevention:** Make external API and AI calls from Server Actions or Route Handlers on the server, never directly from the browser.

---
Source: [Agentic Makers](https://agenticmakers.app/en/help/errors/typeerror-failed-to-fetch) · License: CC BY 4.0
