rsnext/errors/promise-in-next-config.mdx
Delba de Oliveira 44d1a1cb15
docs: Migrate error messages to MDX and App Router. (#52038)
This PR is part of a larger effort to migrate error messages to MDX and
use App Router: https://github.com/vercel/front/pull/23459
2023-07-05 06:11:16 -07:00

23 lines
592 B
Text

---
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 = {
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.