webpack / watchpack

Wrapper library for directory and file watching.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Watching doesn't work if parent directory contains special characters

SpaceK33z opened this issue · comments

Easiest way to reproduce this is by running the webpack tutorial from a directory that contains parentheses in the name.

This is an issue in chokidar (see paulmillr/chokidar#533). There is a PR open to fix it.

This will also be fixed if we move to another watching library, which #41 intends to do.

For more info:

Hi, any news on this?
Is watchpack going to move to sane or are we waiting a patch for chokidar?
Just asking because I'm stuck on a Dropbox Business folder, and there's no way to make it work...

Any workaround?
Thanks

@marcoqu I am trying to get it working by making a link to a folder without any especial characters.
On windows on an admin prompt:
mklink /J "C:\Projects" "C:\Dropbox (Business)\Projects"

commented

@gbmeireles In this case, C:\Projects is the link and C:\Dropbox (Business)\Projects is where the actual files reside?

@shshaw Yes, that`s right.

@shshaw @marcoqu I did not manage to make the symlink approach work like I expected. What did work for me was moving the folder to a valid path and then making a symlink back to the original path but that may not be possible for everyone. Sorry.

@gbmeireles @shshaw The issue with dropbox businness and watchpack is that watchpack does not work with folders with brackets or with symlinks, and dropbox also doens't sync symlinks. So that won't fix it.

The hack that made it work for me is manually replacing is-glob used by chokidar with the latest version (3.1.0?). That actually worked. See also: paulmillr/chokidar#533

You should be able to use npm shrinkwrap to override deep dependencies from webpack/watchpack:
How do I override nested NPM dependency versions?

Here's a copy of the shrinkwrap I used to fix it:

{
  "dependencies": {
    "chokidar": {
      "version": "1.6.1",
      "from": "chokidar@1.6.1",
      "dependencies": {
        "is-glob": {
          "version": "3.1.0",
          "from": "is-glob@2.0.1"
        }
      }
    }
  }
}