Webpack-dev-server: Route name's with a trailing slash makes dev server serve static files with the route name prepended

Created on 12 Sep 2017  路  6Comments  路  Source: webpack/webpack-dev-server

Do you want to request a feature or report a bug?

Bug

What is the current behavior?
Trailing slashes on some route name makes dev server serve static files along with the given route name.

No trailing slash
webpack-working

With trailing slash
webpack-fail

If the current behavior is a bug, please provide the steps to reproduce.

I am simply just using React Router along with webpack-dev-server with historyApiFallback turned on and was trying to make a component route have a dynamic url name path which I could not make a GET request onto because of the aforementioned issue. My webpack config and a snippet of my package.json

What is the expected behavior?
Trailing slash on dev server should not serve the static files with a prepended route name

Please mention your webpack and Operating System version.
Webpack: v3.5.6
OS: Ubuntu 16.04LTS

approved bug

Most helpful comment

I believe I was having this problem. It was solved by adding publicPath: '/' to the output configuration.

All 6 comments

@shellscape I would like to work on this. Is anyone currently working on this?

@fumblehool not to my knowledge, please do give it a go

@geeofree @fumblehool this issue is now past the 30 day stale marker. if it doesn't see any additional activity we'll be closing soon.

@shellscape I've followed the steps to reproduce this issue but It is working fine on my machine.

@shellscape Hello! Sorry for replying just now, I've actually forgotten about this issue and have actually moved on from this after a week or so of publishing this issue. Uhm, I don't really have that much info to give and don't know what info to give even to help with the issue, so I think I'd be okay with it being closed. Thanks for trying to help though @fumblehool!

I believe I was having this problem. It was solved by adding publicPath: '/' to the output configuration.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

subblue picture subblue  路  3Comments

eyakcn picture eyakcn  路  3Comments

antoinerousseau picture antoinerousseau  路  3Comments

mrdulin picture mrdulin  路  3Comments

mischkl picture mischkl  路  3Comments