Skip to content

Commit 46c8d94

Browse files
committed
Fix hanging start
CRA 3 opts-in to a new webpack 5 feature early to save memory: `futureEmitAssets` facebook#6696 This optimization only stores the file sizes during webpack compilation, no longer storing the original source webpack/webpack#8642 This is incompatible with our webpack-dev-server customization setting of `writeToDisk` webpack/webpack#8642 (comment) which tries to read the source after emit, which throws an exception, but that error is swallowed and the `npm start` just hangs. Before we update to webpack 5, where this feature will be the default, we need to stop writing to disk, or find another way to do it than the `writeToDisk` flag.
1 parent 05940c1 commit 46c8d94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/react-scripts/config/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ module.exports = function(webpackEnv) {
173173
? 'static/js/[name].[contenthash:8].js'
174174
: isEnvDevelopment && 'static/js/bundle.js',
175175
// TODO: remove this when upgrading to webpack 5
176-
futureEmitAssets: true,
176+
// FS - writeToDisk and futureEmitAssets are not compatible, so defaulting back to false: https://github.com/webpack/webpack/pull/8642#issuecomment-455342804
177+
futureEmitAssets: false,
177178
// There are also additional JS chunk files if you use code splitting.
178179
chunkFilename: isEnvProduction
179180
? 'static/js/[name].[contenthash:8].chunk.js'

0 commit comments

Comments
 (0)