Skip to content

Commit

Permalink
Add more details to invalid-next-config doc (#42917)
Browse files Browse the repository at this point in the history
This adds some more clarity to the error doc and we can also iterate on
the warnings to show suggestions as well in follow-ups.

x-ref: [slack
thread](https://vercel.slack.com/archives/CHZGRCJSD/p1668430036939189?thread_ts=1668394104.483679&cid=CHZGRCJSD)

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
  • Loading branch information
ijjk committed Nov 14, 2022
1 parent 71fa80b commit 8b4d9e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion errors/invalid-next-config.md
Expand Up @@ -2,7 +2,7 @@

#### Why This Error Occurred

In your `next.config.js` file you passed invalid options that either are the incorrect type or an unknown field.
In your `next.config.js` file you passed invalid options that either are the incorrect type or an unknown field. This warning is shown to help catch typos that cause expected configs to not be applied.

#### Possible Ways to Fix It

Expand All @@ -19,6 +19,12 @@ const nextConfig = {
module.exports = nextConfig
```

For example for the below warning, there is a typo and `rewritess` needs to be renamed to `rewrites` to resolve the issue.

```sh
The root value has an unexpected property, rewritess, which is not in the list of allowed properties
```

### Useful Links

- [`next.config.js`](https://nextjs.org/docs/api-reference/next.config.js/introduction)

0 comments on commit 8b4d9e6

Please sign in to comment.