Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

React-Router cannot GET /path #Error #330

@dharnnie

Description

@dharnnie

I am not getting the desired result from using react-router-dom for routing in my react application. Here is the issue.

Error:
cannot GET /path
I get this error when I try to access a route other than '/'.

app.js code
import {BrowserRouter, Route, browserHistory} from 'react-router-dom'; class App extends Component{ render(){ return( <BrowserRouter history={browserHistory}> <div> <Route exact path="/" component={Login}/> <Route path="/about" component={About}/> </div> </BrowserRouter> ); } } render(<App/>, document.getElementById("root"));
When I try to access /about, I get that response from the browser.

I have edited my config as seen in other issues. I added
devServer:{ contentBase: DIST_DIR, historyApiFallback: true }
and
webpack.output.publicPath: '/'

Nothing changes. react-router v4.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions