Information and problem details found at
https://stackoverflow.com/questions/49763540/webpack-webpack-dev-server-react-shows-directory-listing-when-it-should-show-app
Not my code, but a simple starter repo I've used for testing:
https://github.com/bradtraversy/react_webpack_starter
App runs, worked on one computer until issue was solved.
Shows Directory listing instead of app, same code/repo worked on one computer but not another. See github issue for more information.
I used my C drive to isolate the issue.
mkdir "test test" // works if the directory is testtest
cd "test test"
git clone https://github.com/bradtraversy/react_webpack_starter
cd react_webpack_starter
npm install
npm start (runs webpack-dev-server --mode development --open --hot)
workaround would be to put your project where there are no spaces in the absolute path. Unfortunately, all my projects are in my user directory (C:/Users/John Doe), which is not trivial to change :(
Found it in webpack-serve as well.
They redirected the issue to possibly webpack-dev-middleware since it is a common thread and a likely place.
Any other possible thoughts, clues, or insights?
Same here, I've wasted 14 hours to figure out why this happening.
Just downgrade webpack-dev-server to exact v3.1.1 or remove all spaces in project path till fix.
@frontendmonster yea I moved all my projects on that computer to a different root. Couldn't remove spaces because they were in my username. I'll request on all future work computers they refrain from making usernames with spaces lol
Fixed in https://github.com/webpack/webpack-dev-middleware/commit/e606cf1fa747b9b6d828dc259d346d1cf2f0d549, if somebody still have problem feel free to feedback thanks!
Most helpful comment
Same here, I've wasted 14 hours to figure out why this happening.
Just downgrade
webpack-dev-serverto exact v3.1.1 or remove all spaces in project path till fix.