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

Editing index.html does not trigger a reload #656

Closed
whichsteveyp opened this issue Sep 15, 2016 · 5 comments · Fixed by #1546 · 4 remaining pull requests
Closed

Editing index.html does not trigger a reload #656

whichsteveyp opened this issue Sep 15, 2016 · 5 comments · Fixed by #1546 · 4 remaining pull requests

Comments

@whichsteveyp
Copy link

I'd say this is pretty minor, but I noticed when I updated my index.html <title> it did not trigger a browser reload. I did however see it on manual refresh.

I also noticed that I wasn't exactly clear on how index.html maps to index.js, when I started digging through webpack.config.dev.js. I saw a few comments in there, while looking through it briefly to see if I could resolve this locally and perhaps send a PR. I'm extremely new to webpack, so I don't dig around in here too much yet (and I don't eject really either).

Thanks!

whichsteveyp added a commit to whichsteveyp/create-react-app that referenced this issue Sep 15, 2016
@SpaceK33z
Copy link
Contributor

I also noticed that this is happening. Weird though, because react-scripts seems to use html-webpack-plugin when using that package, it takes care of the live-reloading. Also interesting is that when saving index.html, it does re-compile.

@SpaceK33z
Copy link
Contributor

SpaceK33z commented Sep 20, 2016

Debugged this a little further; because hot modus is enabled, webpack-dev-server doesn't perform a page reload itself, but passes the hot update through to the window so the webpack bundle can perform a XHR request to get the hot updates. However, and I don't know why, it should fall back to the reloading the page if it can't find the hot update.

TL;DR - it's a bug in webpack.

@josephmisiti
Copy link

@SpaceK33z I am seeing the same issue when editing any of the JS files with this configuration - is this the same issue:

├── autoprefixer@6.4.1
├── babel-core@6.14.0
├── babel-eslint@6.1.2
├── babel-jest@15.0.0
├── babel-loader@6.2.5
├── babel-runtime@6.11.6
├── case-sensitive-paths-webpack-plugin@1.1.4
├─┬ chalk@1.1.3
│ └── strip-ansi@3.0.1
├── connect-history-api-fallback@1.3.0
├── cross-spawn@4.0.0
├── css-loader@0.24.0
├── detect-port@1.0.0
├── dotenv@2.0.0
├── escape-string-regexp@1.0.5
├── eslint@3.5.0
├── eslint-loader@1.5.0
├── eslint-plugin-flowtype@2.18.1
├── eslint-plugin-import@1.12.0
├── eslint-plugin-jsx-a11y@2.2.2
├── eslint-plugin-react@6.3.0
├── extract-text-webpack-plugin@1.0.1
├── file-loader@0.9.0
├── filesize@3.3.0
├── find-cache-dir@0.1.1
├── fs-extra@0.30.0
├── gzip-size@3.0.0
├── html-webpack-plugin@2.22.0
├── http-proxy-middleware@0.17.1
├── jest@15.1.1
├── json-loader@0.5.4
├── object-assign@4.1.0
├── path-exists@2.1.0
├── postcss-loader@0.13.0
├── promise@7.1.1
├─┬ react-scripts@0.6.0
│ └── chalk@1.1.3
├── recursive-readdir@2.0.0
├── rimraf@2.5.4
├── sockjs-client@1.0.3
├── strip-ansi@3.0.1
├── style-loader@0.13.1
├── url-loader@0.5.7
├── webpack@1.13.2
├── webpack-dev-server@1.16.1
└── whatwg-fetch@1.0.0

@gaearon
Copy link
Contributor

gaearon commented Sep 30, 2016

@SpaceK33z I am seeing the same issue when editing any of the JS files with this configuration - is this the same issue:

If edits to JS don’t reload the page, please check https://webpack.github.io/docs/troubleshooting.html#watching.

In particular, “safe write” option in some IDEs might cause this: https://webpack.github.io/docs/webpack-dev-server.html#working-with-editors-ides-supporting-safe-write

screen shot 2016-09-30 at 13 15 00

@gaearon gaearon changed the title [0.4.1] editing index.html does not trigger a reload Editing index.html does not trigger a reload Sep 30, 2016
@gaearon
Copy link
Contributor

gaearon commented May 16, 2017

Please help beta test the new version that includes this change!
#2172

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.