Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0a93e32

Browse filesBrowse files
authored
Fix refreshOverlayInterop module scope error (#9805)
1 parent 7965594 commit 0a93e32
Copy full SHA for 0a93e32

File tree

1 file changed

+8
-2
lines changed
Filter options

1 file changed

+8
-2
lines changed

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

Copy file name to clipboardExpand all lines: packages/react-scripts/config/webpack.config.js
+8-2Lines changed: 8 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.