© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•10mo ago•
4 replies
danny

Intermittent 5s Timeout on Supabase Custom Auth Hook (signup): Email Sent, Signup Fails

auth🟡javascript
I'm running into a weird issue with a custom Supabase Auth hook for sending signup emails. Occasionally, when a user signs up, the form shows a Error running hook URI server error and the logs state:

422: Failed to reach hook within maximum time of 5.000000 seconds
422: Failed to reach hook within maximum time of 5.000000 seconds


The user still gets the verification email (though the link doesn't work, since the signup didn't complete). My code[1] is very similar to the example from the docs [2}.

Some details:

* The function is small (~50KB bundle), only imports what’s needed (React Email, Resend, etc).
* Boot time is always fast (200–500ms).
* The error only happens on 
email_action_type === "signup"
email_action_type === "signup"
, and only sometimes (not every signup).
* The Resend API isn’t the issue. The email is always sent, even when the error happens.
* Timing logs show no single step is consistently slow.
* The error is always a 5s timeout from Supabase’s side.

What I've tried:

* Checked bundle size and dependencies (all minimal).
* Added timing logs—no obvious bottleneck.
* Boot time is always fast

Questions:

* Has anyone else seen this with custom auth hooks?
* Any tips for debugging or avoiding these timeouts?
* Is there a way to get more granular logs or see what’s happening inside Supabase during these failures?

Any help or ideas would be much appreciated!

[1]: https://github.com/dnywh/peels/blob/2cd8e188f37adb8bf893d5fb05cb31ca1d55241b/supabase/functions/send-email-for-auth-action/index.ts#L100C7-L116C9
[2]: https://supabase.com/docs/guides/functions/examples/auth-send-email-hook-react-email-resend
image.png
CleanShot_2025-04-28_at_17.45.18.png
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

SUPABASE: Custom auth hook - GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_SECRET
SupabaseSSupabase / help-and-questions
13mo ago
Custom send email hook
SupabaseSSupabase / help-and-questions
2w ago
No Custom Auth Hook
SupabaseSSupabase / help-and-questions
4mo ago
supabase user account signup confirmation email
SupabaseSSupabase / help-and-questions
8mo ago