This repository was archived by the owner on Aug 7, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 40
refactor(HMR): print caught error's message #760
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sis0k0
reviewed
Jan 6, 2019
log.warn(err.stack || err.message); | ||
// Do not modify message - CLI depends on this exact content to determine hmr operation status. | ||
log.error(`Cannot apply update with hmr hash ${currentHash}.`); | ||
log.error(err.message || err.stack); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better - print both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's needed - messages look descriptive enough, i.e.:
CONSOLE INFO file:///app/vendor.js:72111:36: HMR: Checking for updates to the bundle with hmr hash 1a369033d922096d2138.
CONSOLE WARN file:///app/vendor.js:72112:36: HMR: Ignored an update to unaccepted module:
CONSOLE WARN file:///app/vendor.js:72112:36: HMR: ➭ ./main.ts
CONSOLE ERROR file:///app/vendor.js:72113:38: HMR: Cannot apply update with hmr hash 1a369033d922096d2138.
CONSOLE ERROR file:///app/vendor.js:72113:38: HMR: Aborted because ./main.ts is not accepted
Update propagation: ./main.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you say so.
This is to format properly the `HMR_HANDLER` snippet in bundles.
Print caught error message on a `module.hot.check()` or a `module.hot.apply()` failure.
c113721
to
075ffb9
Compare
vakrilov
reviewed
Jan 9, 2019
vakrilov
approved these changes
Jan 9, 2019
7eab5a2
to
adb6d94
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Print caught error's message on a
module.hot.check()
or amodule.hot.apply()
failure.Also:
latestHash
variable in thehmr-update.js
,HMR_HANDLER
snippet in bundlesPR Checklist
What is the current behavior?
Currently, if
module.hot.check()
ormodule.hot.apply()
throws an error, the error's trace is printed.What is the new behavior?
Print error's message if truthy, if not - print error's trace.