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.

Warning about router in console

See original GitHub issue

When I run this as-is in Chrome I get this in the console:

Warning: You cannot change <Router routes>; it will be ignored

It seems to work anyway but would be nice to get rid of the warning.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
capajcommented, May 24, 2016

@dmi3y I did it already, thanks so much!

0reactions
dmi3ycommented, May 24, 2016

Based on this comment.

I did modify the app.js like so (moved Route from render Router into top level constant):

    import React from 'react'
    import ReactDOM from 'react-dom'
    import { browserHistory } from 'react-router'
    import { Router, Route } from 'react-router'

    import Home from './routes/home'
    import { IntlProvider, addLocaleData } from 'react-intl'
    import en from 'react-intl/locale-data/en'
    addLocaleData(en)

    const routes = <Route path='/' component={Home}/>

    class RenderForcer extends React.Component {
      constructor () {
        super()
      }
      componentWillMount () {
        this.forceUpdate()  // a little hack to help us rerender when this module is reloaded
      }
      render () {

        return <IntlProvider locale='en'>
          <Router history={browserHistory}>
            {routes}
          </Router>
        </IntlProvider>
      }
    }

    ReactDOM.render((
      <RenderForcer/>
    ), document.getElementById('app'))

Which made error (warning) goes away.

Also it seems makes sense to separate routes. Either way, if this is something that considered as improvement I can open MR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: How disable system message of Cisco Routers.
Solved: Hi Guys I´m new here, and I´m studying of CCNA in the Dominican Republic. How can I disable systema message or alerts...
Read more >
Vue Router Warning and Router.push is not Functioning
According to docs: Note: Inside of a Vue instance, you have access to the router instance as $router. You can therefore call this....
Read more >
Cisco is also telling customers to disable an L2 traceroute ...
Cisco warning: These routers running IOS have 9.9/10-severity security flaw. Cisco is also telling customers to disable an L2 traceroute ...
Read more >
Vue 3, vue-router console warn - Laracasts
I saw a warning on the console. I can not understand. Can someone explain ?
Read more >
Provide a way to disable warnings for "No match found" when ...
console.warn node_modules/vue-router/dist/vue-router.cjs.js:225 [Vue Router warn]: No match found for location with path "/".
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