Why am I getting a 404 error?
Last checked 31 Aug 2026
Short answer
A 404 means the thing being requested doesn't exist at that path — check for a broken route, a renamed page, a missing database row, or a wrong API endpoint.
What 404 means
404 Not Found means the server couldn't find the specific resource requested — a page route, a file, or a database record. It's a "this doesn't exist here" error, distinct from 403 (exists, but you're not allowed) or a server error.
Diagnostic sequence
- Confirm the exact URL or path being requested when the 404 happens — is it a page route in the app, or an API/data request?
- If it's a page route: check whether that page/route still exists in the code, and whether it was recently renamed or removed.
- If it's a data request: check whether the record being queried (by ID or slug) actually exists in the database, or whether the query is using the wrong identifier.
- If it's an API call to a third-party service: confirm the endpoint URL and API version are correct.
- Check the Logs for backend function 404s if the error originates server-side.
What usually goes wrong
- A page was renamed or a route restructured, but internal links still point to the old path.
- Direct-linking to a dynamic page (e.g.
/product/123) where the record with that ID was deleted or never existed. - Publishing the site and testing a URL that doesn't match the actual route structure (e.g. missing a trailing segment).
- Calling a backend function or edge function by the wrong name or path after it was renamed.
Fixing it
I'm getting a 404 on [exact URL/path]. Check whether this route/record exists, and whether anything recently changed its path or ID.
Related checks
If the 404 happens specifically after publishing but not in Preview, see /questions/why-does-my-app-work-in-preview-but-not-when-published — routing configuration can differ subtly between the two.
Sources
Was this answer helpful?
Related questions
- AnswerWhy is Lovable chat stuck loading?Chat usually gets stuck loading due to a network blip, a very large/complex request, or a backend timeout. Refresh first, then check the console before resending the same prompt.
- AnswerHow do I fix a Lovable build error?Read the exact error message and file it points to, paste it back to Lovable, and let it fix that specific error rather than describing the symptom vaguely.
- AnswerWhy am I getting "Failed to Fetch"?"Failed to fetch" means the browser couldn't complete a network request at all — usually CORS, a down endpoint, a missing/invalid API key, or no internet connection, rather than a code logic error.
- AnswerWhy is my custom domain offline?Custom domains usually go offline because of a missing or changed DNS record, a certificate that hasn't issued yet, or the registrar's records pointing somewhere else — recheck the domain settings and your DNS provider.