gulp-declare icon indicating copy to clipboard operation
gulp-declare copied to clipboard

gulp-declare seems to swallow some files?

Open giladgray opened this issue 10 years ago • 6 comments

Seeing a very confusing bug in my Handlebars workflow: gulp-declare seems to swallow nearly 50% of the files in the stream. When running the task without gulp-declare, all 387 Handlebars files make it through, but when I add gulp-declare, that number drops to anywhere between roughly 160-200. To make matters worse, it's never the same number in two consecutive runs and it's never the same files--random subset each time.

What's this about?

My Handlebars workflow looks like so:

gulp.src config.src
  .pipe rename(...)
  .pipe handlebars()
    .on 'error', notify.onError()
  .pipe wrap('Handlebars.template(<%= contents %>);')
  .pipe declare({
    root: 'Handlebars.templates'
    processName: (path) ->
      match = /([^\/]+)\/scripts.*\/([^\.]+)/.exec path
      return "[#{match[1]}-#{match[2]}]"
  })
  .pipe count('## templates compiled.', logFiles: true)
  .pipe gulp.dest(config.dest)

Pretty standard stuff, taken straight from gulp-handlebars documentation.

giladgray avatar Jan 22 '15 21:01 giladgray

Whoa. This is odd... If you drop your processName method, does it still mess things up?

lazd avatar Jan 22 '15 21:01 lazd

Yep, still messes things up without processName :(

giladgray avatar Jan 22 '15 21:01 giladgray

I'm running into the exact same problem. It's a little more consistent for me, around 99-102 files out of 357 make it through.

Any updates?

dsiddharth avatar Jul 15 '16 07:07 dsiddharth

Actually, bumping back to 0.2.0 of gulp-declare fixed it for me.

dsiddharth avatar Jul 15 '16 07:07 dsiddharth

I have the same problem, it is very troublesome and hard to find. The solution with version 0.2.0 solved the issue for me.

belicekm avatar Mar 23 '17 07:03 belicekm

This is definitely a weird issue. Can someone create a repository that reproduces the issue so I can investigate? Between 0.2.0 and 0.3.0, the only thing that really changed was upgrading dependencies, so perhaps there's and issue upstream.

lazd avatar Apr 23 '17 23:04 lazd