-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Description
Hi
I don't know exactly is this issue with webpack but i think so
I have simple config for router
var ReactappApp = require('./ReactappApp');
var HelloWorld = require('./HelloWorld');
var React = require('react');
var Router = require('react-router');
var Route = Router.Route;
var content = document.getElementById('content');
var Routes = (
<Route path="/" handler={ReactappApp}>
<Route name="hello" path="hello" handler={HelloWorld}/>
</Route>
);
console.log(Routes);
Router.run(Routes,Router.HistoryLocation, function (Handler) {
React.render(<Handler/>, content);
});
So i try to load HelloWorld component at /hello and get Cannot GET /hello
So server doesn't see this route
I use grunt and connect also.
Here is grunt task for webpack:
'webpack-dev-server': {
options: {
hot: true,
port: 8000,
webpack: webpackDevConfig,
publicPath: '/assets/',
contentBase: './<%= pkg.src %>/'
}
and here is webpack config
https://gist.github.com/fellz/b2cc0de81c7b1f5bf442#file-webpack-config
with historyApiFallback: true
'webpack-dev-server': {
options: {
hot: true,
port: 8000,
webpack: webpackDevConfig,
publicPath: '/assets/',
contentBase: './<%= pkg.src %>/',
historyApiFallback: true
}
it's loading ReactappApp instead of HelloWorld
p.s. react-router-component works as expected and perfectly well
mayask, natchiketa, joetm, mauleyzaola, oHervis and 1 moreoHervis
Metadata
Metadata
Assignees
Labels
No labels