/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
errors/undefined-webpack-config.mdx
28 строк
861 B
Delba de Oliveira
Docs: Move `next.config.js` API pages under a `config` folder, fix headings in TS and ESLint config pages (#72465)
08 ноя 2024, 17:48
Не верифицирован
08 ноя 2024, 17:48
0b35ddd
Код
Авторство
О чём код?
--- 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)