Skip to content

Commit

Permalink
Fixes hotcode reloading issue
Browse files Browse the repository at this point in the history
Reviewed By: martinbigio

Differential Revision: D3136032

fb-gh-sync-id: 5666fd45ffa574d2156b03c7bfbda3fe97090f56
fbshipit-source-id: 5666fd45ffa574d2156b03c7bfbda3fe97090f56
  • Loading branch information
subtleGradient authored and Facebook Github Bot 9 committed Apr 6, 2016
1 parent 8200041 commit 41576ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packager/react-packager/src/Bundler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
2 changes: 1 addition & 1 deletion packager/react-packager/src/Resolver/polyfills/require.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ if (__DEV__) { // HMR
}

function acceptAll(modules, inverseDependencies) {
if (modules.length === 0) {
if (!modules || modules.length === 0) {
return true;
}

Expand Down

0 comments on commit 41576ea

Please sign in to comment.