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

Ancestor directory names containing a leading hash not supported #333

Closed
1 of 2 tasks
sodatea opened this issue Aug 25, 2018 · 0 comments
Closed
1 of 2 tasks

Ancestor directory names containing a leading hash not supported #333

sodatea opened this issue Aug 25, 2018 · 0 comments

Comments

@sodatea
Copy link
Contributor

sodatea commented Aug 25, 2018

  • Operating System: macOS High Sierra 10.13.6
  • Node Version: v10.9.0
  • NPM Version: 6.4.0
  • webpack version: 4.17.1
  • webpack-dev-middleware Version: 3.1.3
  • This is a feature request
  • This is a bug

For Bugs; How can we reproduce the behavior?

There are several bug reports in vue-cli repository related to this bug:

To reproduce it, run the following commands:

mkdir "#leadinghash"
cd "#leadinghash"
npx @vue/cli create app --default
cd app
npm run serve -- --open

Expected Behavior

A hello world page.

Actual Behavior

A blank page with following error message logged in terminal:

URIError: Failed to decode param '/%3C%=%20BASE_URL%20%%3Efavicon.ico'

Root Cause

It is actually a bug of url-join(used in middleware.js & util.js):
jfromaniello/url-join#10

require('url-join').('/some/path/with/a/leading/#hash', 'index.html')
// returns '/some/path/with/a/leading#hash/index.html', the `/` before `#` is missing

But I think it is better to solve this issue here because:

  1. Maintainers of url-join does not seem to have a strong willingness to fix this long-standing issue;
  2. Since url-join is only used to join filesystem paths in webpack-dev-middleware, path.posix,join could be a sufficient replacement.
sodatea added a commit to sodatea/webpack-dev-middleware that referenced this issue Aug 25, 2018
sodatea added a commit to sodatea/webpack-dev-middleware that referenced this issue Aug 25, 2018
sodatea added a commit to sodatea/webpack-dev-middleware that referenced this issue Aug 25, 2018
@michael-ciniawsky michael-ciniawsky added this to the 3.2.1 milestone Aug 25, 2018
sodatea added a commit to sodatea/webpack-dev-middleware that referenced this issue Sep 21, 2018
@michael-ciniawsky michael-ciniawsky removed this from the 3.4.1 milestone Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants