Hostinger Horizons: Troubleshooting Supabase

Best practices for fixing errors and troubleshooting issues in Supabase

Updated 4 weeks ago

When it comes to Supabase, our responsibility lies in ensuring that the integration between Supabase and Horizons is properly established and maintained. However, any issues that occur within the Supabase platform itself relate to its functionality and database behavior, which fall under the scope of the Supabase team.

What’s recommended is that you:

  • Review and try following the general troubleshooting steps inside this article.
  • Review if the errors displayed can be found under the Supabase Troubleshooting Documentation.
  • Reach out to Supabase Support in case such issues persist.
  • Consider hiring a developer if the feature is essential to your project and challenges continue — platforms like Fiverr can help you find experienced developers who can assist further.
In general, the best troubleshooting step you could do regarding Supabase-related errors would be to follow the steps here, regarding finding the errors displayed on the browser tools, and directly prompt the fixes regarding such errors displayed.

However, there are a few recommendations we can offer depending on the specific error you’re encountering in Supabase.

Common Issues and Field-Tested Solutions

Supabase & authentication problems

These are the most frequent issues.

Typical root causes

  • Wrong Project URL or Anon/Public key
  • New/duplicate Supabase clients created with placeholder values
  • Missing Auth Providers (e.g., Email not enabled)
  • CORS misconfiguration
  • Row Level Security (RLS) blocking reads/writes
  • Expired invites/secrets after reconnecting projects

Do the following:

  • Use the client file that comes with your project: If you already have a file called customSupabaseClient.js, keep using it. Don’t create new ones like supabase.js or supabaseClient.js with example or placeholder data.
  • Check your project settings in Horizons: Make sure the Project URL and Public/Anon key match exactly with your Supabase project settings.
  • Set up sign-in options in Supabase. Go to Supabase → Auth → Settings. Turn on Email login first, and add other sign-in methods (like Google) if you need them.
  • Add at least one test user: Either create a new one or make sure an existing test account works.
  • Allow your app’s URLs: In Supabase → Auth → URL Configuration, add both your preview and live (production) links.
  • If you’re using Row Level Security (RLS): Double-check that your rules allow the actions your app is trying to do.
  • When you update keys or URLs: Redeploy your app so the changes take effect.
  • If Horizons added extra Supabase files by mistake: Go back to the version before those changes, then use this prompt: “Use customSupabaseClient.js for all Supabase calls. Remove any duplicate clients and update imports accordingly.

Signup error caused by a timing issue in the database

When a user signs up, enters their details, and clicks Confirm, they might see an RLS violation error in the console. This happens because the app tries to update the database before the user is fully authorized. Horizons assumes the user is logged in immediately after signup, but with email verification, authorization only happens after they sign in.

How to fix: 

Instruct Horizons to update the signup and login flow. For example, you can use a prompt like this: “Move initial database manipulation logic from sign up logic to initial sign in. All database manipulation requests that are protected by authorization RLS must be respected and moved to flow where users are authorized – signed in.

The console error usually shows which database table caused the issue. Include that table name in your prompt to get more accurate results from Horizons.

Supabase changing browser tabs causes website navigation

When a user switches browser tabs and returns to the app, they might see a different page than the one they left. This likely happens because of how useEffect, visibilitychange, and Supabase session handling work. When the tab is reopened, the app checks for an active session before Supabase confirms it, so it mistakenly thinks the user isn’t logged in and redirects them to the home page.

Ask Horizons to refactor the Supabase logic that uses the visibilitychange browser event to handle authentication sessions. For example, you can use a prompt like this: “Update Supabase logic that is using `visibilitychange` to check for authentication state. Make sure the user session is fully acknowledged before redirecting the user to the root route.

Missing Supabase Credentials

Every action triggers an error indicating a missing API key or Supabase URL.

How to fix

Disconnect and reconnect your Supabase project. This will re-upload the Supabase API file and automatically add the API key and URL.

Sometimes issues can’t be reproduced or the steps aren’t clear, but logs are saved and can often help identify the problem. Be sure to select the correct timestamp when reviewing them.

Sandbox or Preview fails to start, hangs, or doesn’t finish building

Typical root causes

Dependency and version conflicts

Temporary global or infrastructure incidents

Sometimes external services (e.g., auth or backends) or internal infrastructure can cause temporary failures.

Do this

  • If the logs show external service outages or timeouts, try again later.
  • Avoid making major or destructive changes during incidents. Capture the logs and use Ask to Fix once services have recovered.