[#2387] Uncaught TypeError: Cannot read property 'hot' of undefined#5498
Closed
Kamilius wants to merge 1 commit intowebpack:masterfrom
Closed
[#2387] Uncaught TypeError: Cannot read property 'hot' of undefined#5498Kamilius wants to merge 1 commit intowebpack:masterfrom
Kamilius wants to merge 1 commit intowebpack:masterfrom
Conversation
Contributor
|
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
Contributor
|
I just experienced this as well, and the reason is that it is trying to look up a dependency in the entry chunk. So I think that instead of try-catch, you should just check if However, I don't understand why it is trying to replace a module that is part of a chunk instead of replacing the chunk? here's an inspection of the state at the moment it crashes. The relevant code is /******/ var error = null;
/******/ for(moduleId in outdatedDependencies) {
/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) {
/******/ module = installedModules[moduleId];
/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId];
/******/ var callbacks = [];
/******/ for(i = 0; i < moduleOutdatedDependencies.length; i++) {
/******/ dependency = moduleOutdatedDependencies[i];
/******/ cb = module.hot._acceptedDependencies[dependency];
// ^ this is where it crashes, module is undefinedas you can see, the moduleId is part of the children of |
Member
|
Could you try if #5500 also fixes your issue? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What kind of change does this PR introduce?
bugfix
Did you add tests for your changes?
No, as it is covered by already existing tests
If relevant, link to documentation update:
N/A
Summary
PR is solving a following reported issue "Uncaught TypeError: Cannot read property 'hot' of undefined" (#2387).
While one of installed modules inside a
moduleOutdatedDependenciesisundefined, it was crashing whole hot module replacement and was breaking an existing CSS for a given chunk.Wrapping possible error into a
try/catchblock - totally solved problem, and being tested by me on real project for a last week.Does this PR introduce a breaking change?
No
Other information
N/A