Skip to content

fix: middleware crash (MIDDLEWARE_INVOCATION_FAILED) - #38

Merged
willwearing merged 1 commit into
mainfrom
fix/middleware-trycatch
Mar 22, 2026
Merged

fix: middleware crash (MIDDLEWARE_INVOCATION_FAILED)#38
willwearing merged 1 commit into
mainfrom
fix/middleware-trycatch

Conversation

@willwearing

Copy link
Copy Markdown
Owner

Summary

Production site returning 500 on every page. Middleware crashes in Edge Runtime.

  • Wrap entire middleware in try-catch — errors fall through instead of 500
  • Check Supabase env vars before creating client
  • Log errors for visibility

Test plan

  • npx next build passes
  • Vercel preview deploy succeeds
  • Production returns 200 after merge

🤖 Generated with Claude Code

Production 500 MIDDLEWARE_INVOCATION_FAILED — middleware crashed when
Supabase env vars were undefined or when Edge Runtime hit an error.

- Wrap entire middleware in try-catch, fall through on error
- Check Supabase env vars before creating client
- Log errors for debugging

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
graspful Ready Ready Preview, Comment Mar 22, 2026 3:40pm
web Ready Ready Preview, Comment Mar 22, 2026 3:40pm

@willwearing
willwearing merged commit 796c94a into main Mar 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant