Hostinger AI Builder: Fixing Supabase configuration issues in agentic mode

Resolve authentication, database, and connection errors with Supabase in Hostinger AI Builder agentic mode.

Updated 2 weeks ago

Resolve common authentication, database, and connection errors when using the Supabase integration in Hostinger AI Builder agentic mode, such as authentication loops, Row Level Security (RLS) violations, and project connection errors. Hostinger AI Builder now includes a native integrated backend for newly created projects, but projects previously connected to Supabase can continue using that integration.

To find Supabase settings in Hostinger AI Builder, look for the green bolt in the top navigation bar ⚡

Before you start

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.

  1. Verify credentials: Ensure the Project URL and Public/Anon key match your Supabase API settings exactly.
  2. Use the native client: Locate the customSupabaseClient.js file in your project. Do not create duplicate files like supabase.js, as these often contain placeholder data that breaks the connection.
  3. 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.
  4. Set URL redirects: In Supabase, go to Auth → URL Configuration, and add your project’s preview and production URLs to the Redirect URLs list.
  5. 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 Hostinger AI Builder 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.

  1. 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 Hostinger AI Builder.
  2. Refactor the flow using a prompt in Hostinger AI Builder 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.

  1. Reconnect: Disconnect and then reconnect your Supabase project within the Hostinger AI Builder dashboard to refresh the API file.
  2. 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 AI Builder preview fails to start or npm install hangs after you add Supabase-related libraries, it usually indicates a version conflict.

  1. Pin stable versions: Ensure your package.json uses specific, stable version numbers for libraries instead of broad ranges.
  2. Resolve conflicts via prompt: Use the following prompt in the Hostinger AI Builder editor:
    Resolve dependency conflicts without modifying vite.config.js. Keep only essential packages and prefer stable versions.
  3. 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 AI Builder

NOTES

  • You can get further support on the integration between Hostinger AI Builder and Supabase by clicking Ask Hostinger Agent on the 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.