diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 1e1c02182c2..a0a373e2ccb 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -314,6 +314,7 @@ module.exports = function (webpackEnv) { ...require('../backpack-addons/externals').externals(isEnvProduction), // #backpack-addons externals resolve: { fallback: { + // Falling back to false as these features are not expected to be used by browsers, and node will have native imports to resolve them util: false, assert: false, crypto: false, diff --git a/packages/react-scripts/config/webpack.config.ssr.js b/packages/react-scripts/config/webpack.config.ssr.js index a2262fc8336..1d561bd68fb 100644 --- a/packages/react-scripts/config/webpack.config.ssr.js +++ b/packages/react-scripts/config/webpack.config.ssr.js @@ -321,14 +321,15 @@ module.exports = function (webpackEnv) { }, ...require('../backpack-addons/externals').ssrExternals(), // #backpack-addons externals resolve: { + // Falling back to false as these features are not expected to be used by browsers, and node will have native imports to resolve them fallback: { util: false, assert: false, - crypto: require.resolve('crypto-browserify'), - domain: require.resolve('domain-browser'), - path: require.resolve('path-browserify'), - stream: require.resolve('stream-browserify'), - zlib: require.resolve('browserify-zlib'), + crypto: false, + domain: false, + path: false, + stream: false, + zlib: false, }, // This allows you to set a fallback for where webpack should look for modules. // We placed these paths second because we want `node_modules` to "win"