Skip to content

Multiple bundles on same page breaks reload #69

@pmwmedia

Description

@pmwmedia

I have a page with three bundles. Unfortunately, reloading does not work with new LiveReloadPlugin({port: 0, appendScriptTag: true}).

On startup, everything looks fine:

  1. Webpack starts with three different reloading ports:
$ ../node_modules/.bin/webpack --mode=development --watch
[webpack-cli] Compilation antd-reduced starting...
[webpack-cli] Compilation logdb-web starting...
[webpack-cli] Compilation starting...
<i> [LiveReloadPlugin] Live Reload listening on port 35729
<i> [LiveReloadPlugin] Live Reload listening on port 35730
<i> [LiveReloadPlugin] Live Reload listening on port 35731
[webpack-cli] Compilation finished
[webpack-cli] watching files for updates...
[webpack-cli] Compilation finished
[webpack-cli] watching files for updates...
[webpack-cli] Compilation finished
  1. The HTML page has three reload scripts included:
<script id="webpack-livereload-plugin-script-2b46959be903b68a" async="" src="//localhost:35729/livereload.js"></script>
<script id="webpack-livereload-plugin-script-40d0cd75cb7a994d" async="" src="//localhost:35730/livereload.js"></script>
<script id="webpack-livereload-plugin-script-15a04157ba643cb0" async="" src="//localhost:35731/livereload.js"></script>
  1. And the browser prints the success message even three times into the console:
[Live Reload] enabled
[Live Reload] enabled
[Live Reload] enabled

However, I have noticed in the network monitor that the URLs are incorrectly mapped:

http://localhost:35729/livereload.js -> ws://localhost:35729/livereload
http://localhost:35730/livereload.js -> ws://localhost:35729/livereload
http://localhost:35731/livereload.js -> ws://localhost:35729/livereload

All three HTTP-URLs are mapped to the same WS-URL!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions