Skip to content
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

Open
datho7561 opened this issue Apr 12, 2024 · 4 comments

Comments

@datho7561
Copy link

datho7561 commented Apr 12, 2024

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

npm run build

> [email protected] 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
      ^

<ref *2> 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.

@phated
Copy link
Member

phated commented Apr 14, 2024

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.

@yocontra yocontra transferred this issue from gulpjs/gulp Apr 17, 2024
@scottbert
Copy link

scottbert commented Apr 20, 2024

I also hit this trying to upgrade to Gulp 5.
Gulp 4 used to silently skip missing directories, is there any plan to support an option to include this behaviour in 5? I’d like to not have to test every directory exists before trying to copy it as I’m not responsible for the sources that may or may not exist

@tinogo

This comment has been minimized.

@phated
Copy link
Member

phated commented Apr 28, 2024

@tinogo it's a bug. We'll fix it when we have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants