Changing HMR URL

Hey guys

I’m in the need to setting up a remove dev environment that has a different domain than the usual localhost. I managed to change the root URL with the ROOT_URL environment variable so I can connect to my dev site but the HMR is still using the ws://localhost:3000/__meteor__hmr__/websocket url. I tried changing the HMR URL with the HMR_URL variable but it has no effect. Is there a way to change HMR URL?

Can you provide more details on how you’re starting the project and maybe a reproduction?

By looking at the code, just setting the ROOT_URL should be enough:


1 Like

It is a react project and I’m using these commands on windows:

meteor --verbose --exclude-archs web.browser.legacy,,web.cordova --settings ../config/dev.json

Is it possible that HMR is not using the wsUrl and it’s hardcoded instead?

This is the error I’m getting in the console:


Okay it looks like the issue was with windows. The set command doesn’t work with powershell, so the correct way to start meteor with a custom ROOT_URL is this:

$env:ROOT_URL = ''; meteor npm run start