Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Entry as an object-of-arrays-of-strings does not work #95

Open
ezzatron opened this issue Jul 27, 2018 · 6 comments · May be fixed by #96
Open

Entry as an object-of-arrays-of-strings does not work #95

ezzatron opened this issue Jul 27, 2018 · 6 comments · May be fixed by #96

Comments

@ezzatron
Copy link

  • Operating System: macOS High Sierra
  • Node Version: 10.7.0
  • NPM Version: Yarn 1.7.0
  • webpack Version: 4.16.2
  • webpack-hot-client Version: 4.1.1

Expected Behavior

When entry is configured as described in the README:

..., or an Object who's keys are set to an Array of String.

HMR should detect and handle updates correctly.

Actual Behavior

HMR does not function as expected. Updates are shown in the console, but always show "No Modules Updated". Sample console log:

「hot」 Hot Module Replacement Enabled. Waiting for signal.
「hot」 WebSocket connected
「hot」 App updated. Recompiling src/style.scss
「hot」 webpack: Compiling (<unnamed compiler>)
「hot」 App Updated, Reloading Modules
「hot」 Checking for updates to the bundle.
「hot」 No Modules Updated.
「hot」 App is up to date.

In addition, this seems to prevent fallback to full-page reload from working. A manual reload is required to pick up the changes.

Code

Webpack config: https://gist.github.com/ezzatron/bb4f0609e513d75fd98d070b99fe83c2#file-webpack-config-js

How Do We Reproduce?

I have since "fixed" the issue on the master branch of that same repo, but it required me to use a simple array-of-strings entry configuration, which has flow-on effects for my chunk splitting configuration, which was using the entrypoint name as a way to differentiate chunks.

@shellscape
Copy link
Contributor

@ezzatron
Copy link
Author

@shellscape I wasn't setting that option, no. But I've just tried it, and it doesn't seem to make a difference unfortunately. I'm using webpack-serve's config to set it, so I double checked that the setting was actually making its way to webpack-hot-client with some console logging, and it's definitely receiving the setting.

I've also updated the example repo with allEntries: true if that helps.

@shellscape
Copy link
Contributor

Welp, beyond that, happy to review a PR that resolves this condition.

@ezzatron
Copy link
Author

I've been doing some digging on this issue. I found that HMR does seem to be working, but for the first endpoint only.

I can "fix" the issue, by hacking in these two fixes:

But based on the comments in #96, I understand that this would introduce a regression.

Am I right in assuming that:

@alexander-akait
Copy link
Member

/cc @shellscape Maybe you'll all think about not merge PRs without tests in the future? Now webpack-hot-client is broken with multiple entry points and watch content and you ignore my PR to revert incorrect fix.

Also, you ignore other people's opinions and discussions about solving problems and many features, this violates code of coduct. If you continue to communicate in this style, I'll file a complaint.

@hedefalk
Copy link

+1 on not getting HMR on anything but the first listed entry, also discussed on webpack-serve:

webpack-contrib/webpack-serve#119 (comment)

but I guess this is the correct place if @ezzatron verified the allEntries setting being passed correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants