diff --git a/react-packager/src/DependencyResolver/DependencyGraph/index.js b/react-packager/src/DependencyResolver/DependencyGraph/index.js index 42c1a485..e05575db 100644 --- a/react-packager/src/DependencyResolver/DependencyGraph/index.js +++ b/react-packager/src/DependencyResolver/DependencyGraph/index.js @@ -150,7 +150,16 @@ class DependencyGraph { getOrderedDependencies(entryPath) { return this.load().then(() => { - const absolutePath = path.resolve(this._getAbsolutePath(entryPath)); + const absPath = this._getAbsolutePath(entryPath); + + if (absPath == null) { + throw new NotFoundError( + 'Could not find source file at %s', + entryPath + ); + } + + const absolutePath = path.resolve(absPath); if (absolutePath == null) { throw new NotFoundError(