Skip to content

Commit

Permalink
Yellow boxes for HMR errors
Browse files Browse the repository at this point in the history
Reviewed By: vjeux

Differential Revision: D2795143

fb-gh-sync-id: fd5c92af511258bb1252d991e994a8c37657644e
  • Loading branch information
martinbigio authored and facebook-github-bot-5 committed Dec 30, 2015
1 parent 2ab3fe9 commit eed6dde
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions react-packager/src/Resolver/polyfills/require.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,20 @@
var mod = modules[id];

if (!mod) {
console.error(
console.warn(
'Cannot accept unknown module `' + id + '`. Make sure you\'re not ' +
'trying to modify something else other than a module ' +
'(i.e.: a polyfill).'
);
return;
}

if (!mod.module.hot) {
console.error(
console.warn(
'Cannot accept module because Hot Module Replacement ' +
'API was not installed.'
);
return;
}

if (mod.module.hot.acceptCallback) {
Expand All @@ -120,7 +122,7 @@

mod.module.hot.acceptCallback();
} else {
console.log(
console.warn(
'[HMR] Module `' + id + '` can\'t be hot reloaded because it ' +
'doesn\'t provide accept callback hook. Reload the app to get the updates.'
);
Expand Down

0 comments on commit eed6dde

Please sign in to comment.