DEV Community

Željko Šević
Željko Šević

Posted on • Originally published at sevic.dev on

1

Next.js app in production

Consider the following things when the Next.js app is running in production.

  • Error tracking and alerting

Error tracking and alerting are crucial in the production environment, proactively fixing the errors leads to a better user experience. Sentry is one of the error tracking services, and it provides alerting for unhandled exceptions. You should receive an email when something wrong happens.

Sentry issues show the error stack trace, device, operating system, and browser information. The project dashboard shows an unhandled exception once it's thrown. Run the following commands for integration with the Next.js app.

npm i @sentry/nextjs
npx @sentry/wizard -i nextjs
Enter fullscreen mode Exit fullscreen mode
  • Intl API is not supported in some browsers. Cover it with a fallback.

  • localStorage API is not available when cookies are blocked. Cover it with a fallback.

Course

Build your SaaS in 2 weeks - Start Now

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay