Style not include if access from different devices on local network
Closed this issue ยท 12 comments
Hi, when i access the app in different device in same network, the style in vue component are not include or in another word not being compile. Only css from css file will be show and it become useless if try to test app in different device before uploading it to server
I have a very similar problem: When I run on my Macbook Air (OSX) it works fine, but when I run the same project on my Ubuntu machine, the CSS from the <style /> sections of the .vue components is missing.
There is now an automatic IP detection that should solve this issue. BTW you can use the HMR_URL environement variables.
Hi, this issue still exist if it run on cordova application but can be fixed on production env. Do i need to open new issue? For me it is just minor issue which is not effect too much.
Did you try setting the HMR_URL env var?
How to set HMR_URL? I will look into it
Sorry, where is the documentation for HMR_URL ?
I need to write one. ๐
If you have an issue with HMR not connecting from remote devices, set the HMR_URL env. variable with the IP of your computer. For example:
cross-env HMR_URL=192.168.1.42
You can use HMR_PORT to change the port used by the HMR service.
I guess HMR means Hot Module Reload.
For users like me who deploy to production, is there a need to keep a secondary port open just for HMR (my primary port being 80), or is there a something to do to avoid that while having the styles loading correctly.
If NODE_ENV is set to production, you don't need to have a secondary port open nor to do anything, because the HMR system will be completely disabled and the CSS managed by the standard Meteor building process.
I'm just starting to use a meteor vue integration. I export my env variables in my start command:
export ROOT_URL='http://122.31.1.22:3000'; export HMR_URL=122.31.1.22; HMR_PORT=3000; meteor --settings settings.json
It seem to run fine but I keep getting this error in the browser console:
http://122.31.1.22:3003/socket.io/?EIO=3&transport=polling&t=LvW3vxj&b64=1 net::ERR_CONNECTION_REFUSED
Is there and issue with how I start meteor run?
Set HMR_PORT tu 3003
@nizulzaim It works, thanks!