gulpjs / gulpjs/gulp

ENOENT on nonexistant glob directory with gulp v5.0.1

Open
#2,840 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
32.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Before you open this issue, please complete the following tasks:

* [x] use the search bar at the top of the page to search this repository for similar issues or discussions that have already been opened.
* [ ] if you are looking for help from the gulp team or community, open a [discussion](https://github.com/gulpjs/gulp/discussions).
* [ ] if you think there is a problem with the plugin you're using, open a [discussion](https://github.com/gulpjs/gulp/discussions).
* [x] if you think there is a bug in our code, open this issue.

### What were you expecting to happen?
`src` glob on nonexistent directory to successfully no-op.

### What actually happened?
An `ENOENT` error was thrown.

### Please give us a sample of your gulpfile

```js
const { src, dest } = require('gulp');

function defaultTask(cb) {
return src('input/*.js')
.pipe(dest('output/'));
}

exports.default = defaultTask
```

### Terminal output / screenshots

```sh
Error: ENOENT: no such file or directory, scandir '/project/input'
```

### Please provide the following information:
* OS & version [e.g. MacOS Catalina 10.15.4]: RHEL 8
* node version (run `node -v`): 24.0.1
* npm version (run `npm -v`): 11.3.0
* gulp version (run `gulp -v`): 5.0.1

### Additional information

On attempting to upgrade from gulp v5.0.0 to v5.0.1, an error is thrown that was not thrown before.

In v5.0.0, if the parent directory of the glob didn't exist, nothing was copied and the gulp build proceeded without error.

In v5.0.1, an ENOENT error is now thrown, breaking the build.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.