question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hot reload not working: [react-router] You cannot change <Router routes>

See original GitHub issue

When editing a component from the demo HomePage, I get this message in the console:

Warning: [react-router] You cannot change <Router routes>; it will be ignored

And the hot reload doesn’t happen. This is the full log after saving the file:

2017-04-14 19:00:04.559 client.js?102b:199 [HMR] bundle rebuilding
2017-04-14 19:00:04.861 client.js?102b:207 [HMR] bundle rebuilt in 283ms
2017-04-14 19:00:04.862 process-update.js?e13e:27 [HMR] Checking for updates on the server...
2017-04-14 19:00:04.900 index.js?e6ba:81 [React Transform HMR] Patching Root
2017-04-14 19:00:04.901 process-update.js?e13e:100 [HMR] Updated modules:
2017-04-14 19:00:04.901 process-update.js?e13e:102 [HMR]  - ./src/components/HomePage.js
2017-04-14 19:00:04.902 process-update.js?e13e:102 [HMR]  - ./src/routes.js
2017-04-14 19:00:04.902 process-update.js?e13e:102 [HMR]  - ./src/components/Root.js
2017-04-14 19:00:04.902 process-update.js?e13e:107 [HMR] App is up to date.
2017-04-14 19:00:04.903 browser.js?26d3:49 Warning: [react-router] You cannot change <Router routes>; it will be ignored

Node version: 7.8.0

npm version: 4.2.0

Operating system: macOS Sierra 10.12.4

Command line used: npm run setup, npm run start

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

13reactions
anton-k-gitcommented, Apr 24, 2017

Here is temporary solution, if anyone needs this to be fixed right away:

<Router history={history} routes={routes} key={Math.random()}/>
0reactions
nickytonlinecommented, Jun 22, 2017

Closing as the issue seems to be a React router issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hot reload works only at layout [Warning: You cannot change ...
I get an error when I try to change other file except layout. When I change Layout file everything is OK, nut if...
Read more >
React router hot-reload not working - Stack Overflow
my problem was solved by adding historyApiFallback: true in webpack.config devServer section and <base href="/"> in the head
Read more >
connected-react-router - npm
Start using connected-react-router in your project by running `npm i ... hot reloading while preserving state (with react-hot-reload).
Read more >
Fixing the 'cannot GET /URL' error on refresh with React ...
The first, set up both client and server side routing. The second, redirect all server requests to /index.html which will download all the...
Read more >
gaearon/react-hot-loader - Gitter
We 're having issues with getting RHL (v4) and react-router (v4) to play nicely ... Hot-reloading works great, until a route change is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found