Hostinger Horizons now includes a native integrated backend for newly created projects. Projects that were previously connected to Supabase can still continue using that integration. This guide helps troubleshoot common Supabase-related issues in Hostinger Horizons, such as authentication loops, Row Level Security (RLS) violations, and project connection errors.
Before you start
- Confirm you have access to your Supabase Dashboard.
- For a first attempt at general fixes, follow this guide: Horizons troubleshooting.
- Ensure any external services are online –refer to their status page if needed, and try again later in case of temporary issues or maintenance.
Resolve authentication and RLS issues
Authentication is the most frequent source of errors in Supabase integrations. Follow these steps to ensure your credentials and permissions are correct.
- Verify credentials: Ensure the Project URL and Public/Anon key match your Supabase API settings exactly.
- Use the native client: Locate the
customSupabaseClient.jsfile in your project. Do not create duplicate files likesupabase.js, as these often contain placeholder data that breaks the connection. - Configure Auth providers: In your Supabase Dashboard, go to Auth → Settings. Ensure Email login is enabled. Add later other sign-in methods only if needed.
- Set URL redirects: In Supabase, go to Auth → URL Configuration, and add your project’s preview and production URLs to the Redirect URLs list.
- Check RLS policies: If data isn’t loading, check your Row Level Security (RLS) in Supabase. Ensure your policies allow “Read” or “Write” actions for the authenticated user.
Redeploy your application after updating keys or URLs to ensure changes take effect.
If Horizons added extra Supabase files by mistake, do not attempt to delete them. Instead, undo the changes that created the additional files, then try a prompt similar to this:
Use customSupabaseClient.js for all Supabase calls. Remove any duplicate clients and update imports accordingly.
Fix signup and timing errors
If your app users get an RLS violation message in the console immediately after signing up, the app may be trying to write to the database before the user is fully authorized.
- Check the console error to identify the database table that caused the issue. Include that table name in your prompt to get more accurate results from Horizons.
- Refactor the flow using a prompt in Horizons to move database requests:
Move initial database manipulation logic from sign up to initial sign in. Ensure all requests respect RLS and occur only after the user is authorized.
Fix redirect loops on tab switch
Users may be redirected to the home page when returning to a browser tab. This happens when the app checks the session before Supabase finishes re-validating it.
Update the visibility logic using a prompt like this:
Update the Supabase logic using visibilitychange to check authentication state. Ensure the user session is fully acknowledged before any route redirection.
Restore missing credentials
If every action triggers a Missing API Key error, the connection between platforms may have desynced.
- Reconnect: Disconnect and then reconnect your Supabase project within the Horizons dashboard to refresh the API file.
- Redeploy: After updating keys, redeploy your application to ensure the new environment variables are active.
If you can’t clearly locate or replicate the issue, check the Supabase logs for further details, matching the timestamp with the time when the issue may have happened.
Troubleshooting builds and dependency errors
If the Hostinger Horizons preview fails to start or npm install hangs after you add Supabase-related libraries, it usually indicates a version conflict.
- Pin stable versions: Ensure your
package.jsonuses specific, stable version numbers for libraries instead of broad ranges. - Resolve conflicts via prompt: Use the following prompt in the Hostinger Horizons editor:
Resolve dependency conflicts without modifyingvite.config.js. Keep only essential packages and prefer stable versions. - Revert build config changes: If an AI-suggested tool modified your Vite configuration, revert to the last working version and ask the assistant to implement the feature without altering core build settings.
In addition:
- Avoid adding heavy or complex packages that may cause the installation process to stall.
- Do not manually edit
vite.config.js, as this can lead to persistent build failures.
By following these steps, you can maintain a stable connection between your legacy Supabase backend and Hostinger Horizons.
NOTES
- You can get further support on the integration between Horizons and Supabase by clicking Ask Kodee on the Horizons platform and sharing the details and timeframe of the issue at hand.
- For support regarding internal Supabase database behavior, refer to the Supabase documentation or contact them.
- For practical help directly in your project, consider a reaching out to a developer.