How to get to load an app when dev-server is not localhost #7830
Replies: 2 comments
-
|
Your config is binding the dev server correctly inside the VM, but the URLs sent to the browser still look local. Use the VM address that is reachable from your browser for the public dev URL, and keep const devHost = "192.168.x.y"; // VM IP or DNS name reachable from your browser
export default {
server: {
host: "0.0.0.0",
port: 3032,
},
dev: {
assetPrefix: `http://${devHost}:3032`,
client: {
host: devHost,
port: 3032,
protocol: "ws",
},
},
};The important part in your snippet is that Once the chunk URLs show the VM IP/DNS in Network, that is the signal this side is fixed. If that solves it, you can select the answer so the remote-VM setup is easier to find. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the quickreply. That works like a charm!
…On Thu, Jun 4, 2026 at 9:15 AM Serge Yudin ***@***.***> wrote:
Your config is binding the dev server correctly inside the VM, but the
URLs sent to the browser still look local. server.host: "0.0.0.0" is only
the listen address; if the page asks your host browser for
http://localhost:3032/..., that browser will try its own machine, not the
VM.
Use the VM address that is reachable from your browser for the public dev
URL, and keep 0.0.0.0 only as the bind address:
const devHost = "192.168.x.y"; // VM IP or DNS name reachable from your browser
export default {
server: {
host: "0.0.0.0",
port: 3032,
},
dev: {
assetPrefix: `http://${devHost}:3032`,
client: {
host: devHost,
port: 3032,
protocol: "ws",
},
},};
The important part in your snippet is that assetPrefix is disabled when
isDevServer is true, so the HTML can still fall back to local dev asset
URLs. After changing it, check the page source or Network tab: the main.js
and vendor chunks should use the VM IP/DNS name instead of localhost.
Once the chunk URLs show the VM IP/DNS in Network, that is the signal this
side is fixed. If that solves it, you can select the answer so the
remote-VM setup is easier to find.
—
Reply to this email directly, view it on GitHub
<#7830?email_source=notifications&email_token=AABTIBRVKBO2NBADRKGKSKT46EOY3A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZRG43DMOJTUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-17176693>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABTIBU3S7EE67TCAFMVK7T46EOY3AVCNFSM6AAAAACZZ4VD3OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTOMJXGY3DSMY>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AABTIBQU54BL7TIOEY5WPKD46EOY3A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZRG43DMOJTUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVJTG633UMVZF62LPOM>
and Android
<https://github.com/notifications/mobile/android/AABTIBUTKWAURCJOWHBUCYL46EOY3A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZRG43DMOJTUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Chris Jung
-
https://chrisjung.de
http://develovers.de
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My dev server needs to run in a VM, which I access over network via IPv4. Coming from Vite and knowing the things (and I assured in the docs that it should work the same here, I configured following:
This gives me access to the dev server, also the generated files view. But when I open the
/mainRoute, I get errors loading the generated files:GET http://localhost:3032/static/js/vendors-node_modules_react-dom_index_js-node_modules_react_index_js-node_modules_rsbuild_core-3904be.js net::ERR_CONNECTION_REFUSEDGET http://localhost:3032/static/js/main.js net::ERR_CONNECTION_REFUSEDProduction build works fine but using React Debugger with production build is wild.
Beta Was this translation helpful? Give feedback.
All reactions