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:

image

1 Like

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

set ROOT_URL=https://domain-i-want-to-use.com
meteor --verbose --exclude-archs web.browser.legacy,os.windows.x86_64,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:

450234427_998833911464321_7766497475867961974_n

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 = 'https://domain-to-use.com'; meteor npm run start