Skip to content

Commit 0a93e32

Browse files
authored
Fix refreshOverlayInterop module scope error (#9805)
1 parent 7965594 commit 0a93e32

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
4747
const webpackDevClientEntry = require.resolve(
4848
'react-dev-utils/webpackHotDevClient'
4949
);
50+
const reactRefreshOverlayEntry = require.resolve(
51+
'react-dev-utils/refreshOverlayInterop'
52+
);
5053

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

0 commit comments

Comments
 (0)