diff --git a/packager/react-packager/src/Bundler/index.js b/packager/react-packager/src/Bundler/index.js index b8bfb6baa..a6041e40f 100644 --- a/packager/react-packager/src/Bundler/index.js +++ b/packager/react-packager/src/Bundler/index.js @@ -390,10 +390,11 @@ class Bundler { const numModuleSystemDependencies = this._resolver.getModuleSystemDependencies({dev, unbundle}).length; - entryFilePath = response.dependencies[ - (response.numPrependedDependencies || 0) + - numModuleSystemDependencies - ].path; + + const dependencyIndex = (response.numPrependedDependencies || 0) + numModuleSystemDependencies; + if (dependencyIndex in response.dependencies) { + entryFilePath = response.dependencies[dependencyIndex].path; + } } const toModuleTransport = module => diff --git a/packager/react-packager/src/Resolver/polyfills/require.js b/packager/react-packager/src/Resolver/polyfills/require.js index 05fa02dc4..28a3c2ae7 100644 --- a/packager/react-packager/src/Resolver/polyfills/require.js +++ b/packager/react-packager/src/Resolver/polyfills/require.js @@ -139,7 +139,7 @@ if (__DEV__) { // HMR } function acceptAll(modules, inverseDependencies) { - if (modules.length === 0) { + if (!modules || modules.length === 0) { return true; }