Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMR multiStep mode is broken in webpack 2 #533

Closed
bebraw opened this issue Dec 28, 2016 · 10 comments
Closed

HMR multiStep mode is broken in webpack 2 #533

bebraw opened this issue Dec 28, 2016 · 10 comments
Labels

Comments

@bebraw
Copy link

bebraw commented Dec 28, 2016

Currently enabling multiStep mode in HotModuleReplacementPlugin breaks html-webpack-plugin. The page simply won't refresh correctly breaking the system. The fix for this requires an underlying change as discussed below.

To quote @sokra

the hot update chunks are also "chunk assets" and it looks like that the html-plugin generates a script tag for them.
html-plugin should use the new stats.entrypoints data to generate the script tags. This contains all needed files for an entrypoint in correct order.

Here's a quick search against webpack source, but I can't find a definitive plugin example on a quick look.

To keep this backwards compatible we would need some way to check webpack version. A simple way to do that is to go through require('webpack/package.json').version although it would be better if plugins received the version information from webpack (does this happen already?).

Related to #401.

@jantimon
Copy link
Owner

jantimon commented Dec 29, 2016

Could we expose stats.entrypoints also in webpack 1.x?
This would allow us to have a clean upgrade path for plugin relying on it stats.entrypoints in webpack 2.x

@sokra
Copy link
Contributor

sokra commented Dec 29, 2016

stats.entrypoints is webpack 2 only. We added it for your use case. It lists all files required for an entrypoint in the correct order. So you don't have to do the ordering yourself. It's exposed by webpack. You may separate files by filetype (i. e. put styles before scripts).

@jantimon
Copy link
Owner

jantimon commented Jan 8, 2017

@sokra Is there any reason not to add stats.entrypoints for webpack 1 ?

@moimael
Copy link

moimael commented May 17, 2017

Is this still being worked on ?

@niieani
Copy link

niieani commented Jun 16, 2017

The problem is:

TypeError: Cannot read property 'source' of undefined.

It occurs here.

Specifically:

  1. the asset is deleted: delete compilation.assets[outputName]
  2. and we try to call a method on a now undefined value: childCompilation.assets[outputName].source()

The problem was introduced quite a while ago: be966e7#diff-168726dbe96b3ce427e7fedce31bb0bcR195.

@niieani
Copy link

niieani commented Jun 16, 2017

Actually, scratch that. It's the childCompilation that doesn't have the asset, so while the error is the same, it's not caused by the delete that I've mentioned above. Still, it shouldn't be too hard to fix this, should it?

@stale
Copy link

stale bot commented May 30, 2018

This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days.

@stale stale bot added the wontfix label May 30, 2018
@stale stale bot closed this as completed Jun 14, 2018
@albertotorresfoltyn
Copy link

Here, when changing some js file it realoads the old version

@sibelius
Copy link

sibelius commented Jul 4, 2018

is this fixed on master? or latest version?

@lock
Copy link

lock bot commented Aug 3, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants