Skip to content

@sentry/nextjs on nextjs 12 disables Nextjs HMR and causes full reloads #4176

@remorses

Description

@remorses

Package + Version

  • @sentry/browser 6.15.0
  • @sentry/node 6.15.0
  • raven-js
  • raven-node (raven for node)
  • other: @sentry/nextjs

Version:

6.15.0

Description

@sentry/nextjs disables Nextjs HMR a causes full reloads on every change

I am using the default @sentry/nextjs setup created with the sentry wizard

To currently fix this you can do the following in your next.config.js

const { withSentryConfig: _withSentryConfig } = require('@sentry/nextjs')

const withSentryConfig =
    process.env.NODE_ENV === 'production' ? _withSentryConfig : (x) => x

module.exports = withSentryConfig(config)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nextjsIssues related to the Sentry Nextjs SDK

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions