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

Fixed the hmr connection with host 0.0.0.0 #7357

Merged
merged 2 commits into from
Dec 21, 2022

Conversation

xuqingkuang
Copy link
Contributor

@xuqingkuang xuqingkuang commented Nov 24, 2021

↪️ Pull Request

As well known the server listen host should not be equal to the client connect to, but @parcel/runtime-browser-hmr is doing so.

We usually use 0.0.0.0 as the host to make sure the service is listening to all of the network interfaces, but '0.0.0.0' must not be the client connect to.

💻 Examples

Start the parcel with parcel --host 0.0.0.0 --port 8081 ./demo/index.html in remote dev machine, then start the web browser to connect will got following error message:

Screen Shot 2021-11-24 at 11 01 14 PM

Applied the patch, the HMR_HOST set to null, and the WebSocket connect correctly.

screenshot

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@height
Copy link

height bot commented Nov 24, 2021

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@xuqingkuang xuqingkuang force-pushed the fix/hmr-connect-public-host branch 2 times, most recently from ee0c5b0 to 8429792 Compare November 29, 2021 04:01
@mischnic mischnic merged commit 67106fa into parcel-bundler:v2 Dec 21, 2022
marcins pushed a commit to marcins/parcel that referenced this pull request Jul 14, 2023
* upstream/v2: (33 commits)
  v2.8.3
  Changelog for v2.8.3
  Address bug by updating an asset reference and merge conditions (parcel-bundler#8762)
  Fix CSS order when merging type change bundles (parcel-bundler#8766)
  fixing failing build for contributors on Linux using Node 18 (parcel-bundler#8763)
  Extension: Importers View and separate LSP protocol package (parcel-bundler#8747)
  Bump swc to fix sourcemaps with Windows line endings (parcel-bundler#8756)
  Apply HMR updates in topological order (parcel-bundler#8752)
  Make extension packaging work (parcel-bundler#8730)
  Typed api.storeResult (parcel-bundler#8732)
  Refactor LSP to use vscode-jsonrpc (parcel-bundler#8728)
  Bump swc (parcel-bundler#8742)
  Recursively check reachability when removing asset graphs from bundles in deduplication (parcel-bundler#6004)
  Fix tsc sourcemaps metadata (parcel-bundler#8734)
  Assigning to `this` in CommonJS (parcel-bundler#8737)
  Don't retarget dependencies if a symbol is imported multiple times with different local names (parcel-bundler#8738)
  Add a note about using flow in CONTRIBUTING.md (parcel-bundler#8731)
  filter out title execArgv to workers (parcel-bundler#8719)
  Document more of the BundleGraph class (parcel-bundler#8711)
  Fixed the hmr connection with host 0.0.0.0 (parcel-bundler#7357)
  ...
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.

2 participants