Skip to content

Fix syntax error in contact API route breaking Vercel build#1

Draft
sahaib wants to merge 2 commits into
mainfrom
claude/vercel-deployment-error-y0zy7e
Draft

Fix syntax error in contact API route breaking Vercel build#1
sahaib wants to merge 2 commits into
mainfrom
claude/vercel-deployment-error-y0zy7e

Conversation

@sahaib

@sahaib sahaib commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Problem

The Vercel build failed with a syntax error in app/api/contact/route.ts:

Error: x Expected a semicolon
  ./app/api/contact/route.ts:38:1

Cause

The msg object literal was being closed with }) instead of } — a stray closing parenthesis left over from a previous refactor, which broke the parser. Two related bugs were also present:

  • recaptchaToken was referenced in the reCAPTCHA verification body but never destructured from the request, so it was always undefined.
  • The msg object was composed but never actually sent (no sendEmail call).

Fix

  • Remove the stray ) closing the msg object literal (resolves the build break).
  • Destructure recaptchaToken from the request body.
  • Send the composed message via await sendEmail(msg).

Merging this to main will trigger the Vercel auto-deploy.


Generated by Claude Code

- Remove stray closing paren on the msg object literal (the build-breaking syntax error)
- Destructure recaptchaToken from the request body (was referenced but undefined)
- Actually send the composed message via sendEmail(msg)
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
the-real-pop-collection-shop Ready Ready Preview, Comment Jun 11, 2026 8:18am

lib/sendgrid threw at module import when SENDGRID_API_KEY was unset, which
crashed Next.js build-time page-data collection for /api/contact on Vercel.
Defer the key configuration (and the missing-key error) to the first
sendEmail call so the build no longer depends on the env var being present.
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.

2 participants