Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parent directories with spaces don't seem to be supported #297

Closed
1 of 2 tasks
Gander7 opened this issue Apr 11, 2018 · 4 comments
Closed
1 of 2 tasks

parent directories with spaces don't seem to be supported #297

Gander7 opened this issue Apr 11, 2018 · 4 comments

Comments

@Gander7
Copy link

Gander7 commented Apr 11, 2018

  • Operating System: Windows 10 Home v1709 Build 16299.371
  • Node Version: 9.11.1
  • NPM Version: 5.6.0
  • webpack Version: 4.4.0
  • webpack-dev-middleware Version: 3.1.2
  • This is a feature request
  • This is a bug

Duplicate issue from webpack-dev-server and webpack-server, difference is that having a space in the directory path with webpack-serve gives a Not Found instead of a directory listing.

Information and problem details found (specific to webpack-dev-server, but same issue) here

Found this from tracking down this Webpack-dev-server issue and then this webpack-serve issue

Was redirected to webpack-dev-middleware from webpack-serve issue

Code

Not my code, but a simple starter repo I've used for testing:
https://github.com/bradtraversy/react_webpack_starter

Expected Behavior

Bundled app runs, works on project when there are no spaces in absolute directory path.

Actual Behavior

When there are spaces in the absolute directory path:

  • Shows Not Found on projects using webpack-serve
  • Shows directory listing on projects using webpack-dev-server

See github issue for more information, that issue is specific to webpack-dev-server.

For Bugs; How can we reproduce the behavior?

For webpack-serve, see here
For webpack-dev-server, see here

@stephenmartindale
Copy link
Contributor

I can confirm this behaviour, although I am not using webpack-serve or webpack-dev-server but using webpack-dev-middleware directly, with express.

It also appears to be a regression. My script that runs express works out of a path that would have included spaces when using webpack-dev-middleware v.3.0.1 but serves 404's in place of the webpack output when using v.3.1.2. However, if I move my working copy to a path that does not contain spaces, both version of webpack-dev-middleware serve webpack's output.

@shellscape
Copy link
Contributor

We'd happily review a PR to resolve this.

@stephenmartindale
Copy link
Contributor

I read the commit log and I'm pretty sure that this is the culprit: 08207cc

Basically, on Windows, "%20" should not be replaced by space and spaces should certainly not be replaced by "%20".

The linked commit should be reverted and #284 should be re-opened and closed as "wont-fix" because #284 is actually not a bug at all: If you decode C:\My%20Path\wwwroot\..., the correct output is C:\My Path\wwwroot\.... To get C:\My%20Path\wwwroot\..., you should be decoding C:\My%2520Path\wwwroot\...

@shellscape
Copy link
Contributor

We'd happily review a PR to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants