-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Sourcing files from a folder that doesn't exist using a glob pattern gives a cryptic error instead of nothing happening #134
Comments
Thanks for the report. I think I know where to fix this but it'll take some time. We'll probably move this issue over to the glob-stream repository, as that's where the bug exists. |
I also hit this trying to upgrade to Gulp 5. |
This comment has been minimized.
This comment has been minimized.
@tinogo it's a bug. We'll fix it when we have time. |
FYI there is an easy (but ugly) workaround - you just need to make the glob start before any potentially missing stuff:
|
I spent a day tracking this down. Glad there's already a report for it. I delved a bit, and the specific location I could get to was onAction calls fs.readdir and then onReadDir will I think pavelhoral's solution is to a different problem, as I applied it locally and it did not solve our specific case. For ours, I think it would be important to check if the path exists before trying to walk it. The base of globs is assumed to exist. This was not previously the case in 7.0.0 or earlier. Not throwing the error in onReaddir, in the same way onStat ignores any errors, would likely work very easily, but I'm uncertain if there could be other errors that would be important to catch, such as when reading through symlinks or drive permission issues. A more robust solution would be to add a "prewalk" action which stats the path, ignores errors with empty callback, and queues the walk action on the path in any other case. |
What were you expecting to happen?
Nothing (build succeeds with v4)
What actually happened?
Cryptic error
Please give us a sample of your gulpfile
Minimal reproducer: https://github.com/datho7561/gulp-glob-src-bug-reproducer
Terminal output / screenshots
Followed by a large JavaScript object output as JSON
Please provide the following information:
Additional information
I think it's good that sourcing files from a folder that doesn't exist causes the build to fail, but I think the error message should be more clear and less noisy.
The text was updated successfully, but these errors were encountered: