2023-07-05 15:11:16 +02:00
|
|
|
---
|
|
|
|
title: '`future.webpack5` has been moved to `webpack5`'
|
|
|
|
---
|
2021-06-07 22:48:29 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Why This Error Occurred
|
2021-06-07 22:48:29 +02:00
|
|
|
|
|
|
|
The `future.webpack5` option has been moved to `webpack5` in `next.config.js`.
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Possible Ways to Fix It
|
2021-06-07 22:48:29 +02:00
|
|
|
|
2021-06-17 13:47:02 +02:00
|
|
|
If you had the value `true` you can remove the option as webpack 5 is now the default for all Next.js apps unless opted out.
|
2021-06-07 22:48:29 +02:00
|
|
|
|
2021-06-24 06:33:58 +02:00
|
|
|
If you had the value `false` you can update `next.config.js`:
|
2021-06-07 22:48:29 +02:00
|
|
|
|
|
|
|
Change `future.webpack5` to `webpack5`.
|
|
|
|
|
|
|
|
Current `next.config.js`:
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
```js filename="next.config.js"
|
2021-06-07 22:48:29 +02:00
|
|
|
module.exports = {
|
|
|
|
future: {
|
|
|
|
webpack5: false,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Updated `next.config.js`:
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
```js filename="next.config.js"
|
2021-06-07 22:48:29 +02:00
|
|
|
module.exports = {
|
|
|
|
webpack5: false,
|
|
|
|
}
|
|
|
|
```
|