question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--hmr-host is not available

See original GitHub issue

🐛 bug report

I’m trying to configure the host that hot module replacement responds, since I am developing in a remote machine but accessing from local browser.

🎛 Configuration (.babelrc, package.json, cli command)

Zero configuration

🤔 Expected Behavior

Running parcel serve ... --host 0.0.0.0 --hot-host 12.34.56.78 should make the hot module replacement connect to the socket in wss://12.34.56.78:1234 instead of wss://127.0.0.1:1234 or wss://0.0.0.0:1234

😯 Current Behavior

It errors with

error: unknown option '--hot-host'

Even if prepending --hot it does not work:

error: unknown option '--hot-host'

However, the README states those flags exist, and I see that HMRRuntime.js tries to use these. I assume that --hot-port will also not work.

🌍 Your Environment

Software Version(s)
Parcel v2.0.0-nightly.429
Node v14.12.0
npm/Yarn v1.22.5
Operating System Ubuntu 20.04.1 LTS

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
windware-onocommented, Feb 14, 2022

I agree it needs --hmr-host.

I’m running parcel behind a reverse proxy of another host, so specifying --host as the exposed host will fail saying that it cannot bind to that IP address.

What would work is the host for binding should be different from the host that parcel connects to from the browser.

Also, parcel watch --host 127.0.0.1 doesn’t work as it still keeps on listening to all the interfaces as I assumed this will change the IP it binds to according to the documentation.

Ideally, parcel watch --host 127.0.0.1 --hmr-host wss://host.browser.connects.to:443 would make parcel listen to 127.0.0.1 while the browser connects to wss://host.browser.connects.to:443 with its HMR. (I’m specifying the full URL, since it implies even though parcel is running without https locally, the exposed reverse proxy host has ssl termination and needs to be connected with https. Perhaps --hmr-connect would be a better name.)

1reaction
ranisaltcommented, Oct 22, 2020

I didn’t know about serve --help, I always resorted to the README/website 😆

Edit: there’s another mistake, --host describes as “defaults to listening on all interfaces” but actually by default it only listens to loopback (localhost).

Read more comments on GitHub >

github_iconTop Results From Across the Web

CLI - Parcel
The watch command is similar to serve , but does not start a dev server (only a HMR server). However, it automatically rebuilds...
Read more >
Laravel Vite Issue - Laracasts
I read #28 issue, but not sure that it's my case. I downloaded "use-hmr-host-when-set" branch files, then compile it by running run npm...
Read more >
Laravel (Sail): Vite Dev Server not found (404) - Stack Overflow
Im using laravel-vite, latest Laravel9 BUT same issue! endless 404. – ofumbi. Jul 10 at 19:35 · @ofumbi - Check that config.server.hmr.host is ......
Read more >
Laravel Mix HMR with HTTPS | Codecourse Blog
If that's you too, here's a guide on how to get it working flawlessly. ... That fixes the hostname, but not the HTTPS...
Read more >
Versatile Multiscale Milestoning Utilizing the OpenMM ...
spatial reach available to the computational biophysics ... being observed, an issue that was not present for the MMVT-. SEEKR version.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found