question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gulp 4 - alpha2/alpha3 duplicate path bug

See original GitHub issue

Bug Origin gulp.src is not removing duplicate paths with gulp4 alpha3, but in gulp4 alpha2 it does. We concat ordered paths, then a glob path and it works as expected in alpha2.

What actually happened? Multiple paths are included when using gulp.src

Please post a sample of your gulpfile (preferably reduced to just the bit that’s not working)

gulp.src(["./lib/angular.js", "./lib/**/*.js"]);

Mulitiple /lib/angular.js items are listed instead of it filtering duplicate paths. Verified the casing in the filesystem matches the casing in the src.

What version of gulp are you using? gulp4 alpha3

What versions of npm and node are you using? npm 5.6 (also tried 5.2)

Workaround Removing the local node_modules path under node_modules\gulp\node_modules temporarily fixes this issue, but when you run npm i again it re-builds this folder and creates the problem again. In alpha2, there was no node_modules subdirectory.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
phatedcommented, Jan 4, 2018

From deeper digging, this is a non-trivial problem inside node-glob so I’m going to close this as such: The behavior of invalid globs is undefined, especially cross-platform. Please fix your globs by removing non-standard patterns like /./ or /../.

@alohaninja You might also be interested in the uniqueBy option as supplied by glob-stream: https://github.com/gulpjs/glob-stream#optionsuniqueby

0reactions
phatedcommented, Jan 4, 2018

@alohaninja to clarify your assumption: there should be no assumption made that upgrading to a new alpha or the published 4.0.0 should work - there have been breaking changes between each alpha and the published versions. That being said, I want this behavior to be consistent between Windows and Posix, which it currently is not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is this gulp script behaving differently between v4.0.0 ...
It appears that the two full paths get concatenated now, whereas previously only the relative paths from the glob (i.e. when app\images\**\*.* ...
Read more >
Issues for ZURB Foundation | Drupal.org
Title Status Priority Category Versi... Dragging icon disappears in any dragable table Active Normal Bug report 8.x‑6... Using the XY‑grid by default Closed (fixed) Normal...
Read more >
Just Sharing My Gulpfile - CSS-Tricks
My trouble was that Gulp 4 requires a CLI version of 2.x while Gulp 3, for whatever reason, used a 3.x version. Essentially...
Read more >
Setting up gulp 4 for automatic Sass compilation and CSS ...
Note — if you're using zsh you will get an error saying there are no matches found for this gulp version. Try putting...
Read more >
Using Gulp 4 in your workflow for Sass and JS files
Then those utility tasks will be run in our default Gulp task when we type gulp on the command line. Creating constants for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found