Gulp v3.x Hack to fix: Error: gulp-resolve-dependencies: File not found and tasks being executed out of order

Will Bittner
1 min readApr 17, 2015

--

Ok so I hope this helps some people out. I wasted 4 hours on this. Essentially there is a bug in Gulp 3.x but fixed in the “not out yet” 4.x. https://github.com/gulpjs/gulp/issues/96

I believe it is due to the fact that file i/o is written async, so after a clean, then a move of files, the stream will return but the file i/o is async.

So, there is lots of stuff about how to “do it right with callbacks, or defer” , but, this is simple and it works. Let me know if you have any issues.

Be careful NOT to set task1 as a dependency in task2! Just call them both in your build task or w/e.

Here, you can check out a working example on the following gulpfile.js that I am working with at the moment to build a boilerplate build system:

--

--