简体中文
vite-plugin-shopify-theme

Phone and LAN debugging

Make Shopify preview and Vite assets reachable from a device while respecting the boundary between LAN HTTP and remote HTTPS.

Phone debugging has two reachability requirements: the device must open the Shopify CLI preview and it must reach Vite assets on the development machine. Making Vite listen on the LAN does not by itself guarantee that the browser accepts the final resource combination.

Check in this order

  1. Set Vite's server.host to 0.0.0.0 or a specific LAN interface;
  2. Set the plugin option devOrigin: "network" so the development Mixer uses Vite's network URL instead of a loopback URL;
  3. Pass Shopify CLI's native --host option through Theme Run, for example shopify-theme dev --path theme-frame --environment development --host 0.0.0.0;
  4. Confirm that the phone and development machine share a network and that the firewall allows both the Shopify preview and Vite listeners;
  5. Open the LAN preview printed by Shopify CLI and inspect Vite asset requests on the phone.

If Vite has no network URL, devOrigin: "network" stops with an error asking you to set server.host.

HTTPS and tunnels

Do not combine a remote HTTPS preview with a LAN HTTP Vite origin; browsers normally block that as mixed content. For remote-device access, provide an explicit HTTPS proxy or tunnel and pass its complete origin through devOrigin, such as https://dev.example.com. The value must be an HTTP(S) origin without a path, query, or hash; Vite still owns listening and transport. See the repository phone and LAN example for the installed version's syntax.

Maintained by ShopZend

Verified:2026-09-23

Updated:2026-10-05