rsnext/errors/improper-devtool.md
James Mosier 435bf65784
Warn/revert custom devtool in development mode (#14285)
Warn users and revert their `devtool` when they manually change the `devtool` in development mode. For this addition, I check to ensure the `devtool` is custom (i.e. different than what is set by Next) and has a value (`false` is fine as a custom `devtool`!).

As described in [this issue (13963)](https://github.com/vercel/next.js/issues/13963), changing the `devtool` in development mode can cause issues with performance.

Fixes #13963
2020-06-24 04:15:57 +00:00

588 B

Improper webpack devtool used in development mode

Why This Error Occurred

Next.js chooses the most optimal devtool for use with webpack. Changing the devtool in development mode will cause severe performance regressions with your application.

Possible Ways to Fix It

Please remove the custom devtool override or only apply it to production builds in your next.config.js.

module.exports = {
  webpack: (config, options) => {
    if (!options.dev) {
      config.devtool = options.isServer ? false : 'your-custom-devtool'
    }
    return config
  },
}