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.

Bug if he doesn't found a file

See original GitHub issue

Hi, I have a simple task but gulp bug when he doesn’t found any file with .png :

gulp.task('tasks0', ['task'],  function(){

  return gulp.src('app/assets/img/upload/other/*.{png,jpg,jpeg}')
  .pipe(responsive({
      // produce multiple images from one source
      '*.jpg':
        {
          width: 720,
          withoutEnlargement:false,
          progressive: true,
          quality:70
        },
      '*.png':
        {
          width: 720,
          progressive:true,
          compressionLevel : 7,
          withoutEnlargement:true
        },
      '*':
      {
        width: 720,
        progressive:true,
        withoutEnlargement:false
      }
    }))
  .pipe(gulp.dest('app/assets/img/upload/other/'));
}
); 

Regards Quentin

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mahnunchikcommented, Aug 18, 2017
1reaction
lstanardcommented, Aug 17, 2017

@mahnunchik - I tried both the errorOnUnusedConfig and silent options but neither seemed to fix the issue.

I ended up adding an error handler and that at least catches the error so it doesn’t kill the process completely.

return gulp.src(SRC)
        .pipe(responsive({
            '*': {
                width: '50%',
                height: '50%',
            }
        }).on('error', function (err) {
            gutil.log('No matching images found in source: ' + SRC, '');
        }))
        .pipe(rename(function (path) {
            path.basename = path.basename.replace(/(@2x)/g, '');
        }))
        .pipe(gulp.dest(DEST));
Read more comments on GitHub >

github_iconTop Results From Across the Web

File is "moved or deleted" or "cannot be found" error when you ...
File is "moved or deleted" or "cannot be found" error when you download PDF files in Internet Explorer 11 in Windows - Microsoft...
Read more >
How to Fix the "Item Not Found" Windows Error When Deleting ...
It happens when, even though the file or folder is there, Windows says that it is failing to delete it because it can't...
Read more >
Suppress FORFILES "no files found" error - Stack Overflow
The issue is that the script returns an error code and prints "ERROR: No files found with the specified search criteria" if it...
Read more >
Python FileNotFoundError: [Errno 2] No such file or directory ...
This error is usually raised when you use the os library. You will see an IOError if you try to read or write...
Read more >
Types Of File Preview Errors And How To Handle Them
What happened: If you're seeing the error message [file type] files can't be previewed, it's because Dropbox doesn't recognize the file type ......
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