I have a React app with navigation powered by react-router
that I run in development with webpack-dev-server
and the history fallback option enabled. H
It doesn't work because it can't load your javascript bundle. I'm guessing that the problem is with your path in script tag in HTML. Probably you have specified the path to app.js with dot at the beginning like this one
, if this is true please remove dot and check if the problem still exists
Let's illustrate what is the difference between ./app.js
and /app.js
Case 1. You are loading page using first level of routes like /
or /intro
./app.js
: HTML tries to load script from http://address/app.js
/app.js
: HTML tries to load script from http://address/app.js
No difference
Case 2. You are loading page using second level of routes /build/pattern
./app.js
: HTML tries to load script from http://address/build/app.js
- doesn't exist/app.js
: HTML tries to load script from http://address/app.js
- OK