You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The usage of chokidar to watch all files in the project (except for dotfiles and node_modules by default) can lead to issues if it encounters strangely defined file or folder names. This can be easily demonstrated when using docz in a laravel project due to it's dependency on the symfony/finder component which contains a test fixture folder named r+e.gex[c]a(r)s (see https://github.com/symfony/finder/tree/master/Tests/Fixtures). (Note: this isn't fixed by simply setting the src config option as implied in #58 as the src directory is not used when configuring the files to watch for changes.)
While it would be easy, and more accurate, to shift blame to the chokidar lib, I feel like adding a config option to define a custom ignored watch paths regex would allow us to not only circumvent the issue for lot of cases but, and perhaps more importantly, will also allow us improve performance by ignoring directories that we know will have no bearing on docz and the components it utilises. There also doesn't seem to be much movement on that bug in their repo (paulmillr/chokidar#699).
To Reproduce
Install laravel installer: composer global require laravel/installer
Create a new laravel project: laravel new blog && cd blog
Add src config option to show that it's not relevant for this bug: echo "export default {src: './resources/js'}" >> doczrc.js
Start the docz server: yarn docz dev
/private/tmp/laravel/blog/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)"
at parse (/private/tmp/laravel/blog/node_modules/snapdragon/lib/parser.js:473:15)
at Parser.parse (/private/tmp/laravel/blog/node_modules/snapdragon/lib/parser.js:477:24)
at Snapdragon.parse (/private/tmp/laravel/blog/node_modules/snapdragon/index.js:122:28)
at Snapdragon.<anonymous> (/private/tmp/laravel/blog/node_modules/braces/lib/braces.js:40:45)
at Braces.parse (/private/tmp/laravel/blog/node_modules/braces/lib/braces.js:66:26)
at Braces.expand (/private/tmp/laravel/blog/node_modules/braces/lib/braces.js:87:18)
at create (/private/tmp/laravel/blog/node_modules/braces/index.js:142:15)
at memoize (/private/tmp/laravel/blog/node_modules/braces/index.js:298:13)
at Function.braces.create (/private/tmp/laravel/blog/node_modules/braces/index.js:165:10)
at Function.braces.expand (/private/tmp/laravel/blog/node_modules/braces/index.js:81:17)
at getDirParts (/private/tmp/laravel/blog/node_modules/chokidar/index.js:435:31)
at FSWatcher.<anonymous> (/private/tmp/laravel/blog/node_modules/chokidar/index.js:452:24)
at /private/tmp/laravel/blog/node_modules/readdirp/readdirp.js:220:72
at Array.filter (<anonymous>)
at /private/tmp/laravel/blog/node_modules/readdirp/readdirp.js:220:12
at /private/tmp/laravel/blog/node_modules/readdirp/readdirp.js:193:38
Bug Report
Describe the bug
The usage of chokidar to watch all files in the project (except for dotfiles and node_modules by default) can lead to issues if it encounters strangely defined file or folder names. This can be easily demonstrated when using docz in a laravel project due to it's dependency on the symfony/finder component which contains a test fixture folder named
r+e.gex[c]a(r)s
(see https://github.com/symfony/finder/tree/master/Tests/Fixtures).(Note: this isn't fixed by simply setting the
src
config option as implied in #58 as the src directory is not used when configuring the files to watch for changes.)While it would be easy, and more accurate, to shift blame to the chokidar lib, I feel like adding a config option to define a custom ignored watch paths regex would allow us to not only circumvent the issue for lot of cases but, and perhaps more importantly, will also allow us improve performance by ignoring directories that we know will have no bearing on docz and the components it utilises. There also doesn't seem to be much movement on that bug in their repo (paulmillr/chokidar#699).
To Reproduce
composer global require laravel/installer
laravel new blog && cd blog
yarn add react react-dom && yarn add docz@next docz-theme-default@next --dev
echo "export default {src: './resources/js'}" >> doczrc.js
yarn docz dev
See here for a repository I've prepared earlier: https://github.com/andy-shea/docz-chokidar-watch-bug
Expected behavior
Docz server should start without an error
Environment
The text was updated successfully, but these errors were encountered: