Skip to content

ENOENT on nonexistant glob directory with gulp v5.0.1 #2840

@bpfoster

Description

@bpfoster

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

  • 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.
  • if you think there is a problem with the plugin you're using, open a discussion.
  • 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

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

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

exports.default = defaultTask

Terminal output / screenshots

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions