diff --git a/Libraries/Utilities/HMRClient.js b/Libraries/Utilities/HMRClient.js index 1301c47ecfa768..cb901e86ed7f0f 100644 --- a/Libraries/Utilities/HMRClient.js +++ b/Libraries/Utilities/HMRClient.js @@ -98,7 +98,7 @@ Error: ${e.message}` RCTExceptionsManager && RCTExceptionsManager.dismissRedbox && RCTExceptionsManager.dismissRedbox(); } - modules.forEach(({name, code}, i) => { + modules.forEach(({id, code}, i) => { code = code + '\n\n' + sourceMappingURLs[i]; require('SourceMapsCache').fetch({ @@ -116,7 +116,7 @@ Error: ${e.message}` code = [ `__accept(`, - `${name},`, + `${id},`, `function(global,require,module,exports){`, `${code}`, '\n},', diff --git a/local-cli/server/util/attachHMRServer.js b/local-cli/server/util/attachHMRServer.js index 2e0051d4b429c7..1e9852b8c1e72e 100644 --- a/local-cli/server/util/attachHMRServer.js +++ b/local-cli/server/util/attachHMRServer.js @@ -252,7 +252,7 @@ function attachHMRServer({httpServer, path, packagerServer}) { return JSON.stringify({ type: 'update', body: { - modules: bundle.getModulesNamesAndCode(), + modules: bundle.getModulesIdsAndCode(), inverseDependencies: client.inverseDependenciesCache, sourceURLs: bundle.getSourceURLs(), sourceMappingURLs: bundle.getSourceMappingURLs(), diff --git a/packager/react-packager/src/Bundler/HMRBundle.js b/packager/react-packager/src/Bundler/HMRBundle.js index caf3ec67b53cf9..1153b164822b90 100644 --- a/packager/react-packager/src/Bundler/HMRBundle.js +++ b/packager/react-packager/src/Bundler/HMRBundle.js @@ -34,10 +34,10 @@ class HMRBundle extends BundleBase { return Promise.resolve(); } - getModulesNamesAndCode() { + getModulesIdsAndCode() { return this._modules.map(module => { return { - name: JSON.stringify(module.name), + id: JSON.stringify(module.id), code: module.code, }; });