WebpackDevServer breaks on complex nested routes
See original GitHub issueWas running into this for a few days (on master & since upgrading to 3.0.0)
I had some routes like
/releases
/releases/:version
My :version param takes a semver number, like 1.2.3.
They work perfectly when navigating around the app using <Link /> etc, and /releases works when hard-refreshing the page, but hard refreshing on a url like localhost:3000/releases/1.2.3 returns an error like this:

I confirmed that it’s specifically having periods in paths that are broken (by adding a route handler on /releases/foo; finally managed to track it down to this issues. The fix proposed by stefanfisk works perfectly when I edited webpack/server.dev.js.
https://github.com/rackt/react-router/issues/676#issuecomment-73963306
I think this is a general enough problem to fix; it certainly shouldn’t be happening - do you want me to clean up the code and submit a PR to 3.0.0?
Issue Analytics
- State:
- Created 8 years ago
- Comments:28 (14 by maintainers)

Top Related StackOverflow Question
Add the
publicPathto youroutputoption in your webpack config:I totally forgot you’re on master, the above solution would only work on
v3.0.0! For master, please try this:Sorry for the unnecessary troubles!