-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cannot run remix run
on multiple apps at once
#296
Comments
The dev CLI now honors |
Is that |
Another problem arises if you are working under I was trying to monkey-patch the A possible solution could be: let ws = new WebSocket("${window.location.protocol === 'https' ? 'wss' : 'ws'}://${window.location.hostname}:${port}/socket"); But don't know/understand internals very well, so I don't get the reason because |
I think the CLI flags for both are useful and should take precedence over values in config, personally. Thinking here in cases where I just want to run the app quickly but something else is running in the background. It'd also be nice if instead of just dropping the process, Remix could be smart and just look for another port if the default/configured port is in use (though I imagine we'd want a way to turn off that behavior). |
This would be really useful so you don't need to care about that at all |
Had an issue closely related to this a while ago. Problem: Live reload wasn't working and the server and needed to be restarted to reload the changes. Unfortunately this started happening again with remix version 1.2.2 however on close inspection I noticed something different Problem: Live reload not working when developing on HTTPS
I'm no networking/server/sockets expert but I believe in order to connect to a websocket server using the wss protocol... Unfortunately that doesn't seem to be the case here remix/packages/remix-dev/cli/commands.ts Line 90 in c66a5a8
Even though the proposed solution is already implemented remix/packages/remix-react/components.tsx Line 1389 in c66a5a8
Went ahead and modified my installation in the node_modules folder to let protocol = "ws:"; and it seems to solve the issue Maybe I'm missing something (e.g can I configure/attach an https server somehow?) but any chance someone could take a look or share an alternative fix Cheers What version of Remix are you using?1.2.2 Steps to Reproduce
Expected BehaviorLive reload works when changes are applied to the code in the app folder Actual BehaviorLive reload does not work/restart because it is unable to connect to the websocket server via wss without an HTTPS server Browser inspect console error when app starts
|
Pilfered through the source code and found that you can set it via command line. If you update the devServerPort in the remix.config.js file in conjunction with setting REMIX_DEV_SERVER_WS_PORT via command line you can run multiple apps at once with live reload. You would also have to set the PORT to be different than the other app, of course.
The issue can be found in @remix-run/dev/config.js file. The config is being read but for whatever reason, the devServerPort isn't being set on appConfig causing the devServerPort to be the new port when compiled but the ws port remains 8002. |
you are absolutely right, I've resolved it here :) #2456 seems like the extra function that we |
The funny thing is that the WebSocket server port is the one that I don't care about and Remix should just pick a random port. Oddly though, Remix App Server was updated to pick a random port if the default was already open. This is rarely what I want. I'd much rather RAS just exit with error and force me to pick a PORT. |
it does, it just wasn't making it to LiveReload 🙈 |
🤖 Hello there, We just published version Thanks! |
Closing as #2456 is merged now |
that didn't fix it 😢 |
Fixed by #3447 ? |
Should be ok by now, please reopen if not. |
Why change the package.json scripts by adding more Env Vars
|
Because the port used by the WebSocket server is hard-coded, there's currently no way to concurrently run dev for two Remix apps at once.
remix/packages/remix-dev/cli/commands.ts
Line 52 in c1821e4
The
run
andwatch
commands would need to be updated to accept an alternative argument to set the WebSocket's server port. It would be nice if we could also pass these as command line arguments as needed.Thoughts?
The text was updated successfully, but these errors were encountered: