Skip to content

Commit

Permalink
Fix #5794 by ignoring ENOENT errors in ContextModuleFactory.addDepend…
Browse files Browse the repository at this point in the history
…encies
  • Loading branch information
simon-paris committed Oct 11, 2017
1 parent 2df0bf1 commit 5e3039d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/ContextModuleFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,15 @@ module.exports = class ContextModuleFactory extends Tapable {
const subResource = path.join(directory, seqment);

fs.stat(subResource, (err, stat) => {
if(err) return callback(err);
if(err) {
if(err.code === "ENOENT") {
// ENOENT is ok here because the file may have been deleted between
// the readdir and stat calls.
return callback();
} else {
return callback(err);
}
}

if(stat.isDirectory()) {

Expand Down

0 comments on commit 5e3039d

Please sign in to comment.