App Finishers

Fix guide · updated 2026-11-09

Bolt error 500 (Internal Server Error): find which part of your app failed and fix it

500 (Internal Server Error) · Edge Function returned a non-2xx status code · Database error saving new user · infinite recursion detected in policy

Your Bolt app shows 500 or Internal Server Error, or a red line in the browser console says the server responded with a status of 500. A 500 only says that a server hit an error it didn't handle. It doesn't say which server, or why. In a Bolt app, several different places can send one, and the address of the failing request tells you which. Find that first, then read the real error behind it.

1. Find the request that failed

In Chrome, open the console (Ctrl + Shift + J on Windows, Cmd + Option + J on a Mac) and make the error happen again. Look for a red line like this one:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Next to it is the address that failed. The Network tab lists the same requests with their status codes. Match the address:

2. A server function returned 500

Server functions (Supabase calls them Edge Functions) run the backend part of your app: payments, emails, calls to AI services. When one crashes or returns an error, the Supabase client in your app only reports Edge Function returned a non-2xx status code. The function's own error message is in the response it sent back. There are two ways to read it:

import { FunctionsHttpError } from '@supabase/supabase-js'

const { data, error } = await supabase.functions.invoke('my-function', { body })
if (error instanceof FunctionsHttpError) {
  console.error('Function error', await error.context.json())
}

Ask Bolt to add that check, make the error happen again, and the console shows what the function actually said. The usual causes:

If the message is Failed to send a request to the Edge Function instead, your app couldn't read any answer from the function. From a browser, the usual reason is CORS: the function doesn't answer the browser's OPTIONS check, sent before the real request, or its answer lacks the CORS headers. Edge Function returned a non-2xx status code covers that fix and every status code a function can return.

3. Sign-up fails with "Database error saving new user"

This 500 comes from Supabase Auth while it creates the account. The cause is usually not Auth itself but a trigger: many apps run a function for every new user that copies them into a profiles table. When that function fails, the sign-up fails with it, and Auth only returns this generic message. Supabase's docs warn about exactly this: a failing trigger can block sign-ups.

To see the real error, open the logs right after a failed sign-up. On a Bolt database, that's database icon → Logs, then PostgreSQL or Authentication in the dropdown. On your own Supabase project, it's the Logs page of the dashboard. Then compare your function with Supabase's example:

create function public.handle_new_user()
returns trigger
language plpgsql
security definer set search_path = ''
as $$
begin
  insert into public.profiles (id, first_name, last_name)
  values (new.id, new.raw_user_meta_data ->> 'first_name', new.raw_user_meta_data ->> 'last_name');
  return new;
end;
$$;

Each error the log can show here, with its fix, is in Database error saving new user.

4. A database query returns 500

Most database errors come back as a 400, 401 or 403. A 500 from /rest/v1/ is rarer, and in apps like these it's usually one of two errors:

For the recursion, Supabase's documented fix moves the lookup into a security definer function in a private schema, then calls that function from the policy. Here's their example, for lists shared with members. Drop the old policy first, since the new one takes its name:

create schema if not exists private;

create function private.user_list_ids()
returns setof uuid
language sql
security definer
set search_path = ''
stable
as $$
  select list_id from public.list_members
  where user_id = (select auth.uid())
$$;

revoke execute on function private.user_list_ids() from public;
grant usage on schema private to authenticated;
grant execute on function private.user_list_ids() to authenticated;

create policy "members read lists" on lists for select
to authenticated
using ( id in (select private.user_list_ids()) );

Keep that function out of the public schema. A security definer function in a schema your API exposes can be called by anyone, with its owner's rights. You can paste this example into Bolt and ask it to apply the same pattern to your own tables. How to find the policy behind the loop, the admin and team versions of the fix, and the errors that can follow it are in Infinite recursion detected in policy.

If you get a 403 or permission denied for table instead, that's a different problem with its own fix: see Supabase permission denied for table (42501).

5. The preview is blank and one of your files returns 500

Bolt's preview runs a development server inside your browser. When one of your files has an error that stops it from compiling, that server answers with a 500 for that file, and the page stays blank. We reproduced it with a missing closing tag in src/App.tsx. The console showed the 500 for /src/App.tsx, and the error panel over the page gave the real message, with the line and column:

[plugin:vite:react-babel] …/src/App.tsx: Unterminated JSX contents. (6:10)

So the fix is in that file, at that line, not on a server. Copy the panel's message, or the red text from the Terminal tab in Code view, into Bolt and ask it to fix that line. That's also Bolt's own advice for a blank preview: give it the exact error. Running npm run build in the terminal shows compile errors too. Most Bolt and Lovable web apps are built with the same tool, Vite, so the messages are the same: Lovable build unsuccessful shows how to read the common ones.

6. Bolt itself is failing

If Bolt's editor, chat or preview fails rather than your app, check status.bolt.new first. During an incident, wait and try again later. If there's no incident, Bolt's troubleshooting guide suggests turning off ad blockers and other extensions, and your VPN, then trying again. If Bolt says your project is too large for a prompt, its docs suggest removing unused files and splitting large files into smaller ones.

Still stuck?

Write down three things: the failing address, its status code, and the real error from the logs or the response. That's what anyone helping you will ask for first, and for a server function, the real error often points straight to the line to fix.

Other Bolt app problems? See Fix a Bolt app.