Files
vercel__next.js/errors/undefined-webpack-config.mdx
Delba de Oliveira 0b35ddd825 Docs: Move next.config.js API pages under a config folder, fix headings in TS and ESLint config pages (#72465)
This PR:

- Moves `next.config.js` options under a "config" folder which includes
references for other configuration such as the ESLint plugin. I figure
it would be tidier than having "Next.config.js Options" and "Config" in
the API reference.
- Fixes the issue with the "config" folder not showing up in canary:
https://linear.app/vercel/issue/DOC-3749/bug-figure-out-why-new-config-folder-isnt-showing-up-in-the-canary
- Fixes the indentation issues and missing example header (caused by an
invisible character).

Redirects: https://github.com/vercel/front/pull/38704
2024-11-08 14:48:55 +00:00

29 lines
861 B
Plaintext

---
title: Missing webpack config
---
## Why This Error Occurred
The value returned from the custom `webpack` function in your `next.config.js` was undefined. This can occur from the initial config value not being returned.
## Possible Ways to Fix It
Make sure to return the `webpack` config from your custom `webpack` function in your `next.config.js`
```js filename="next.config.js"
module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
// Note: we provide webpack above so you should not `require` it
// Perform customizations to webpack config
config.plugins.push(new webpack.IgnorePlugin(/\/__tests__\//))
// Important: return the modified config
return config
},
}
```
## Useful Links
- [Custom webpack config Documentation](/docs/pages/api-reference/config/next-config-js/webpack)