2023-07-05 15:11:16 +02:00
---
title: 'Improper webpack `devtool` used in development mode'
---
2020-06-24 06:15:57 +02:00
2023-07-05 15:11:16 +02:00
## Why This Error Occurred
2020-06-24 06:15:57 +02:00
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.
2023-07-05 15:11:16 +02:00
## Possible Ways to Fix It
2020-06-24 06:15:57 +02:00
Please remove the custom `devtool` override or only apply it to production builds in your `next.config.js`.
2023-07-05 15:11:16 +02:00
```js filename="next.config.js"
2020-06-24 06:15:57 +02:00
module.exports = {
webpack: (config, options) => {
if (!options.dev) {
config.devtool = options.isServer ? false : 'your-custom-devtool'
}
return config
},
}
```