Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #6720: HMR not working in Firefox if proxy option present #7318

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/react-dev-utils/WebpackDevServerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,13 @@ function prepareProxy(proxy, appPublicFolder) {
process.exit(1);
}

// If proxy is specified, let it handle any request except for files in the public folder.
// If proxy is specified, let it handle any request except for
// files in the public folder and WebpackDevServer socket endpoint.
dmile marked this conversation as resolved.
Show resolved Hide resolved
function mayProxy(pathname) {
const maybePublicPath = path.resolve(appPublicFolder, pathname.slice(1));
return !fs.existsSync(maybePublicPath);
const isPublicFileRequest = fs.existsSync(maybePublicPath);
const isWdsEndpointRequest = pathname.startsWith('/sockjs-node'); // used by webpackHotDevClient
return !(isPublicFileRequest || isWdsEndpointRequest);
}

if (!/^http(s)?:\/\//.test(proxy)) {
Expand Down