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

Path Quoting/Escaping Exception For Directories With Symbols And/Or Spaces #1202

Open
Enteleform opened this issue Jan 18, 2019 · 5 comments
Labels
needs reproduction Waiting for a reproduction link (codepen, code sandbox, GH repos)

Comments

@Enteleform
Copy link

  • [x ] I confirm that this is a issue rather than a question.

Bug report

Version

0.14.8

Steps to reproduce

Create a path on a Windows 10 machine:
C:\Some\Path\[2019-01-18] Some Project

Follow the Getting Started > Inside An Existing Project instructions from the VuePress documentation.

Execute the NPM script:
docs:dev

What is expected?

The development server will start.

What is actually happening?

The following exception is thrown. It seems to be caused by a lack of path quoting and/or escaping, although I'm not sure whether that is happening within the VuePress codebase or somewhere along the dependency chain.

> [email protected] docs:dev D:\Projects\Proposals\[2019-01-18] ClyphX Features
> vuepress dev docs


 WAIT  Extracting site metadata...

Compiling

* Client █████████████████████████ compiling (0%)


D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\snapdragon\lib\parser.js:473
        throw new Error('no parsers registered for: "' + self.input.slice(0, 5) + '"');
        ^

Error: no parsers registered for: "] Cly"
    at parse (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\snapdragon\lib\parser.js:473:15)
    at Parser.parse (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\snapdragon\lib\parser.js:477:24)
    at Snapdragon.parse (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\snapdragon\index.js:122:28)
    at Snapdragon.<anonymous> (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\braces\lib\braces.js:40:45)
    at Braces.parse (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\braces\lib\braces.js:66:26)
    at Braces.expand (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\braces\lib\braces.js:87:18)
    at create (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\braces\index.js:142:15)
    at memoize (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\braces\index.js:298:13)
    at Function.braces.create (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\braces\index.js:165:10)
    at Function.braces.expand (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\braces\index.js:81:17)
    at getDirParts (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\chokidar\index.js:435:31)
    at FSWatcher.<anonymous> (D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\chokidar\index.js:452:24)
    at D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\readdirp\readdirp.js:220:72
    at Array.filter (<anonymous>)
    at D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\readdirp\readdirp.js:220:12
    at D:\Projects\Proposals\[2019-01-18] ClyphX Features\node_modules\readdirp\readdirp.js:193:38
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] docs:dev: `vuepress dev docs`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] docs:dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Fico\AppData\Roaming\npm-cache\_logs\2019-01-18T12_11_45_873Z-debug.log

Other relevant information

  • Your OS: Windows 10
  • Node.js version: 11.5.0
  • Is this a global or local install? local
  • Which package manager did you use for the install? yarn
@shigma
Copy link
Collaborator

shigma commented Mar 8, 2019

Can you provide a reproduction repo?

@Enteleform
Copy link
Author

@shigma
The Getting Started page that I linked to from the official documentation literally just creates a "Hello World" bare-bones project. I can make a repo if you really need it, but the issue is pretty straightforward & will happen if you create a new VuePress project within a folder named [TimeStamp] Project Name and then run the vuepress dev docs command on a computer running Windows 10 (and possibly other OS's).

@ulivz
Copy link
Member

ulivz commented Mar 9, 2019

I can make a repo if you really need it.

I hope you'll take a look at our issue template. Repro is a must for your problem.

@Enteleform
Copy link
Author

Enteleform commented Mar 9, 2019

@josensanchez
Copy link

It happens to me in a Linux but without spaces in the directory name. just with the "]"

In my case is a PHP(Laravel) + Vue project which has a /vendor directory (something like node_modules but for composer)
and it fails

~/vendor/symfony/finder/Tests/Fixtures/r+e.gex[c]a(r)s/...

./PHPAPP_directory/node_modules/snapdragon/lib/parser.js:473
        throw new Error('no parsers registered for: "' + self.input.slice(0, 5) + '"');

Error: no parsers registered for: "]a(r)"

As the project already has all the documentation scattered into the source code with some API documents etc, I was trying to generate from the base directory of the project and use the docs directory for higher-level documents ... but this problem prevents me from having success.

I have no idea why anyone would want to name directories like this but ... unfortunately, it happens.

PS: It will be really useful to have the ability to ignore such dependencies directories, the same way as node_modules is ignored by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction Waiting for a reproduction link (codepen, code sandbox, GH repos)
Projects
None yet
Development

No branches or pull requests

5 participants