silverwolf-x/project / errors /undefined-webpack-config.mdx
silverwolf-x's picture
download
raw
861 Bytes
---
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)

Xet Storage Details

Size:
861 Bytes
·
Xet hash:
066f50cb4fc4c9632abe40b7e5064245bbeb7591f9d839ffba0c3ac38c21b7ed

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.