rsnext/errors/promise-in-next-config.mdx

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
592 B
Text
Raw Normal View History

---
title: Promise In Next Config
---
## Why This Error Occurred
The webpack function in `next.config.js` returned a promise which is not supported in Next.js. For example, below is not supported:
```js filename="next.config.js"
module.exports = {
2020-05-18 21:24:37 +02:00
webpack: async function (config) {
return config
},
}
```
## Possible Ways to Fix It
In Next.js versions above `12.0.10`, `module.exports = async () =>` is supported.
For older versions, you can check your `next.config.js` for `async` or `return Promise`.
Potentially a plugin is returning a `Promise` from the webpack function.