Next.js error monitoring for Vercel apps, server routes, and frontend crashes
Squasher connects Next.js client errors, route handler failures, middleware issues, Vercel logs, source maps, session replay, releases, and AI triage in one production debugging workflow.
import { init } from "@squasher-ai/nextjs";
init({
apiKey: process.env.SQUASHER_API_KEY!,
projectId: process.env.SQUASHER_PROJECT_ID!,
environment: process.env.NODE_ENV,
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,
});Capture the failure where Next.js actually runs.
Next.js production issues can start in the browser, a route handler, middleware, a serverless runtime, or a deploy. Keep those signals together before triage starts.
Capture React boundaries, hydration failures, browser breadcrumbs, and replay.
Wrap API-style handlers so server exceptions keep request and release context.
Monitor middleware failures that can happen before a route renders.
Forward serverless, edge, build, and deployment logs into the same triage flow.
Resolve minified browser traces back to readable production source files.
Start with the SDK, then add logs and readable traces.
Keep setup aligned with the docs: initialize the Next.js SDK, wrap the server surfaces you use, forward Vercel logs, and upload source maps for each release.
Initialize the Next.js SDK
Use instrumentation.ts to initialize @squasher-ai/nextjs with project, environment, and release metadata.
Wrap routes and middleware
Use the documented helpers for route handlers and middleware where you need server-side capture.
Add Vercel logs
Attach the Vercel log drain when deployment, build, serverless, and edge logs are part of response.
Upload source maps
Upload .next source maps for the same release value used by SDK events.
Move from error to logs, replay, source map, and release context.
A Next.js crash rarely lives in one layer. Squasher keeps client stack traces, Vercel logs, source-mapped frames, replay, and release regressions close enough for AI triage to summarize.
Group the issue by stack trace, route, runtime, and release.
Inspect Vercel logs and breadcrumbs around the failing request or client action.
Review replay, source-mapped frames, and the AI summary before assigning the fix.
Common Next.js issues need cross-layer context.
These are the production failures where logs, source maps, and replay tend to matter more than a raw stack trace.
Connect the client stack trace to route, release, replay, and browser details.
Show failed client requests beside server route logs and release context.
Use Vercel logs and route metadata to separate runtime pressure from app bugs.
Compare edge, node, preview, and production behavior without losing the error.
Group new release regressions before they become support escalations.
Answers for Next.js teams evaluating error monitoring.
Short answers about App Router, Vercel logs, source maps, browser monitoring, edge runtimes, and privacy.
- Does Squasher support the Next.js App Router?
- Yes. The Next.js SDK docs show instrumentation, middleware, route-handler wrapping, and client error boundaries that fit App Router projects.
- Can Squasher monitor Vercel logs for a Next.js app?
- Yes. Use the Vercel log drain when serverless, edge, build, and deployment logs need to sit beside application errors and AI triage.
- Do I still need source maps?
- Yes for readable production browser traces. Keep the SDK release value aligned with the source-map upload release for each deployment.
- Does this replace browser-side JavaScript monitoring?
- No. Next.js monitoring and browser monitoring work together: server routes and middleware need server context, while frontend crashes need browser breadcrumbs and replay.
- What about edge runtime differences?
- Treat edge and serverless runtime differences as production signals. Capture the route, runtime, release, and nearby logs so responders can verify the failure mode.
Give every Next.js regression the context responders need.
Connect SDK errors, Vercel logs, source maps, replay, and AI triage before the next deployment turns a route bug into a customer-impacting incident.