react-scripts 2.1.2+ has only one webpack.config.js now (prod + dev are configs are combined into one). This breaks react-app-rewired because it looks for webpack.config.prod.js
I know this module is no longer maintained, but up to this point (react-scripts 2.1.1 or earlier) it still allows you to manually modify parts of the config without issues. Just a heads up for anymore who may ran into this issue.
https://github.com/arackaf/customize-cra seems to rely on this package as well
I can resolve this issue with update source code for 2 files as below:
start.js
process.env.NODE_ENV = process.env.NODE_ENV || "development";
const paths = require("./utils/paths");
const overrides = require('../config-overrides');
const webpackConfigPath = paths.scriptVersion + "/config/webpack.config";
const devServerConfigPath = paths.scriptVersion + "/config/webpackDevServer.config.js";
// load original configs
const configFactory = require(webpackConfigPath);
const devServerConfig = require(devServerConfigPath);
// override config in memory
require.cache[require.resolve(webpackConfigPath)].exports =
(NODE_ENV) => overrides.webpack(configFactory(NODE_ENV), process.env.NODE_ENV || NODE_ENV);
require.cache[require.resolve(devServerConfigPath)].exports =
overrides.devServer(devServerConfig, process.env.NODE_ENV);
// run original script
require(paths.scriptVersion + "/scripts/start");
build.js
process.env.NODE_ENV = 'production';
const paths = require('./utils/paths');
const overrides = require('../config-overrides');
const webpackConfigPath = paths.scriptVersion + "/config/webpack.config";
// load original config
const configFactory = require(webpackConfigPath);
// override config in memory
require.cache[require.resolve(webpackConfigPath)].exports =
(NODE_ENV) => overrides.webpack(configFactory(NODE_ENV), process.env.NODE_ENV || NODE_ENV);
// run original script
require(paths.scriptVersion + '/scripts/build');
@bugzpodder
Just switch to craco JS (it's crafted for CRA V2) Well as said below, it's broken too...
https://github.com/sharegate/craco
@AndyOGo Currently also broken with CRA v2.1.2: https://github.com/sharegate/craco/issues/61
@AndyOGo Currently also broken with CRA v2.1.2: sharegate/craco#61
yep, i got it in CRA V2.1.2 .
is there some solutions?

@alejandronanez simply stick to the v2.1.1 and wait for fix. There is no other workaround possible here.
oh...god.
in CRA 2.1.3 also got this problem .:(
seems rescripts is working:
https://github.com/rescripts/rescripts
You can test using
yarn add [email protected]
Next steps:
Just pushed 2.0.1 to npm thanks @tiffon for the PR + testing.
Thank you so much Tim and @tiffon for quick resolution. Life saver for me !
Most helpful comment
346 is now merged.
You can test using
Next steps: