Skip to content

avoid calling accept handler on disposed modules - #5500

Merged
sokra merged 1 commit into
masterfrom
bugfix/hmr-disposed-handler
Aug 11, 2017
Merged

sokra merged 1 commit into
masterfrom
bugfix/hmr-disposed-handler

Conversation

@sokra

@sokra sokra commented Aug 11, 2017

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?
bugfix

Did you add tests for your changes?
yes

If relevant, link to documentation update:
N/A

Summary
avoid calling accept handler on disposed modules
fixes #2387
fixes #5498

Does this PR introduce a breaking change?
no

Other information

@webpack-bot

Copy link
Copy Markdown
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@wmertens

Copy link
Copy Markdown
Contributor

It seems to work for me, but I don't have a sure-fire way to reproduce the undefined-hot-module issue.

The logic seems ok. Is it really ok to ignore the case where module is undefined? What if the module is part of an entry chunk and not available by id on the installedModules object?

@sokra

sokra commented Aug 11, 2017

Copy link
Copy Markdown
Member Author

When module is undefined is was disposed in the dispose phase of HMR. This happens when a module is either removed or replaced with a newer version. In this case we should not call the accept handlers of the (old) module.

@sokra
sokra merged commit f7bcba7 into master Aug 11, 2017
@sokra
sokra deleted the bugfix/hmr-disposed-handler branch August 11, 2017 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncaught TypeError: Cannot read property 'hot' of undefined

3 participants