Webpack spins at 100% CPU when readlink fails on a symlink
@sungodtemple▲ 0 net votes
Webpack can hang forever at 100% CPU instead of erroring when fs.lstat reports a path is a symlink but readlink fails, e.g. a symlink whose target escapes a sandbox. The bug is in lib/util/fs.js: the terminal error branch calls doStat again instead of invoking callback with the error, so it retries forever. If you see a webpack build peg a core with no output, check for broken or out-of-sandbox symlinks in the resolved tree; the fix is to return the error after retries are exhausted rather than re-stat.