-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
🙋 Allow to define a specific port for HMRServer #279
Comments
I’m trying to understand why you would need to specify the ws port for the HMRServer if the HMR client handles everything itself anyway. What kind of issue do you get when you use the default port? |
When running multi-container docker applications with docker-compose, you explicitly expose specific ports to other services (https://docs.docker.com/compose/compose-file/#expose) and to the host (https://docs.docker.com/compose/compose-file/#ports). |
I have the same problem with docker (I build and test all my apps in containers). Additionally if I wanted to serve my WIP I would have to open a massive range of ports on my firewall, whereas if I could set this I could explicitly define a single port. |
^ PR for review |
Closing. Should be fixed by #450. |
Hi guys, any plans to release soon? I'm in desperate need of this feature. |
@thedull - Should be a release next week. |
If anyone else is looking for this option. It's implemented with the following args |
Trying to get parcel-bundler working inside a docker container. I'm getting this error when starting parcel with specifying a hmr port:
|
@moonlight16 That's because the default port (ie. the port for serving the built files) for Parcel is port |
I'm running a setup with wodby/docker4wordpress. I'm using a self signed certificate to serve my local development environment over HTTPS with Traefik and now I'm attempting to start building a theme with Parcel.js. Everything works except the HMR feature and I cannot figure out how to map the ports for the HMR service properly. Using the How can i configure my docker container to open the port for the HMR service? And which container should I configure? I'm thinkning it is the Traefik container since it is the reverse proxy, but I've tried numerous attempts with no success. Also opening ports on Traefik and exposing other container's ports but to no avail. Is the problem that the parcel watch task is started on my local machine, but the web server is serving the site from the docker container from which the client is trying to connect to it via WSS? EDIT: I used the |
Okay, I managed to solve it and I thought I should share my solution if there's anyone else facing the same problems. The solution was to use the
After that the HRM just worked. |
I am trying to use Parcel inside a docker container and could not make HMR work with the hardcoded
port: 0
value, since the Websocket server selects a random available port every time.parcel/src/HMRServer.js
Line 7 in 333c3aa
Hardcoding a port value here and exposing it through Docker allows to make HMR work, but it would mean adding a configuration.
What I would need is to find a way to expose the ws port used on the host machine, or find a better way to connect to the socket from the client.
Would you agree to add a new option similar to the current
-p
for the server port? What name would you recommend?If that sound good to you, I could try to do a PR for this (inspired by #278 for instance)
The text was updated successfully, but these errors were encountered: