Skip to content

Commit

Permalink
Fix refreshOverlayInterop module scope error (#9805)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianschmitz committed Oct 21, 2020
1 parent 7965594 commit 0a93e32
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/react-scripts/config/webpack.config.js
Expand Up @@ -47,6 +47,9 @@ const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
const webpackDevClientEntry = require.resolve(
'react-dev-utils/webpackHotDevClient'
);
const reactRefreshOverlayEntry = require.resolve(
'react-dev-utils/refreshOverlayInterop'
);

// Some apps do not need the benefits of saving a web request, so not inlining the chunk
// makes for a smoother build process.
Expand Down Expand Up @@ -335,7 +338,10 @@ module.exports = function (webpackEnv) {
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
new ModuleScopePlugin(paths.appSrc, [
paths.appPackageJson,
reactRefreshOverlayEntry,
]),
],
},
resolveLoader: {
Expand Down Expand Up @@ -627,7 +633,7 @@ module.exports = function (webpackEnv) {
entry: webpackDevClientEntry,
// The expected exports are slightly different from what the overlay exports,
// so an interop is included here to enable feedback on module-level errors.
module: require.resolve('react-dev-utils/refreshOverlayInterop'),
module: reactRefreshOverlayEntry,
// Since we ship a custom dev client and overlay integration,
// the bundled socket handling logic can be eliminated.
sockIntegration: false,
Expand Down

0 comments on commit 0a93e32

Please sign in to comment.