You cannot change <Router routes>; it will be ignored
See original GitHub issueHi, I cannot seem to setup the hot reloading. It actually works, but I keep getting the error in console You cannot change <Router routes>; it will be ignored
This is my router file
import React from 'react';
import ReactDOM from 'react-dom';
import {Provider} from 'react-redux';
import {Router, browserHistory} from 'react-router';
import {syncHistoryWithStore} from 'react-router-redux';
import { getRootNode } from '../../helpers/routing_helpers';
// Components
// Hot reload
import { AppContainer as HotLoaderAppContainer } from 'react-hot-loader';
import AppRoutes from './routes';
export default function (inject: Function, {Store}: IContext) {
const history = syncHistoryWithStore(browserHistory, Store);
const renderApp = (CurrentAppRoutes: any) => {
ReactDOM.render(
<HotLoaderAppContainer>
<Provider store={Store}>
<Router history={history}>
{ CurrentAppRoutes }
</Router>
</Provider>
</HotLoaderAppContainer>,
getRootNode('react-root')
);
};
renderApp(AppRoutes);
if (module.hot) {
module.hot.accept('./routes.jsx', () => {
const NextAppRoutes = require('./routes').default;
renderApp(NextAppRoutes);
});
}
};
And a routes file
import React from 'react';
import {Route, IndexRoute } from 'react-router';
// Components
import Layout from './components/layout';
import HomePage from './components/home_view';
import ProfilePage from '../user/components/profile_view';
const AppRoutes = (
<Route path="/" component={Layout}>
<IndexRoute component={HomePage} />
<Route path="profile" component={ProfilePage} />
</Route>
);
export default AppRoutes;
Would you be able to help please?
Issue Analytics
- State:
- Created 7 years ago
- Comments:31 (1 by maintainers)
Top Results From Across the Web
Getting `You cannot change <Router routes>; it will be ignored ...
It looks like it's saying if you're on the current page and the route doesn't change, but everything else stayed the same, then...
Read more >react-route,react-hot-loader.webpack (You cannot change ...
You cannot change 《Router routes》; it will be ignored. I don't know how to solve this issue.there is code: webpack code: var path...
Read more >react-route,react-hot-loader.webpack (You cannot change ...
[Solved]-react-route,react-hot-loader.webpack (You cannot change <Router routes>; it will be ignored)-Reactjs ... The router actually should never change, so you ...
Read more >解決React-Router 在Webpack-dev-server 的HMR (hot-module ...
如果你使用React-Router,那麼一定會搭配Webpack 一起服用吧? ... `You cannot change <Router routes>; it will be ignored` when hot-loading.
Read more >How to Handle Routing in a React Application using the React ...
So it renders the JSX elements. This path prop is used to identify the portion of the URL that the router should match....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

My “solution” is to override the console.error, and filter the warning out. It’s only included when HMR is enabled.
I think this issue should this be kept open util it’s officially fixed?