gulpjs / gulpjs/glob-stream

Sourcing files from a folder that doesn't exist using a glob pattern gives a cryptic error instead of nothing happening

Open
#134 8 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
181
Forks
50
PR merge metrics
No merged PRs in 30d

Description

### 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

```sh
npm run build

> example-gulp@0.1.0 build
> gulp my-broken-task

[17:27:38] Using gulpfile ~/Documents/Projects/example-gulp/gulpfile.js
[17:27:38] Starting 'my-broken-task'...
[17:27:38] Finished 'my-broken-task' after 4.52 ms
node:events:492
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, scandir '/home/davthomp/Documents/Projects/example-gulp/libs'
Emitted 'error' event on Domain instance at:
at Transform.emit (node:domain:539:12)
at ReadableState.afterDestroy (/home/davthomp/Documents/Projects/example-gulp/node_modules/streamx/index.js:493:19)
at Transform._destroy (/home/davthomp/Documents/Projects/example-gulp/node_modules/streamx/index.js:629:5)
at ReadableState.updateNonPrimary (/home/davthomp/Documents/Projects/example-gulp/node_modules/streamx/index.js:386:16)
at ReadableState.update (/home/davthomp/Documents/Projects/example-gulp/node_modules/streamx/index.js:367:71)
at ReadableState.updateReadNT (/home/davthomp/Documents/Projects/example-gulp/node_modules/streamx/index.js:536:10)
at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
```
Followed by a large JavaScript object output as JSON

### Please provide the following information:
* Fedora Linux 39
* 20.10.0
* 10.2.3
* 5.0.0

### 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.