atilafassina / quantum

Tauri + SolidStart. Batteries Included 🔋
MIT License
471 stars 23 forks source link

Blank white screen when running pnpm tauri ios dev for physical device #37

Open iskng opened 1 month ago

iskng commented 1 month ago

Stock app, Mac 14.5 build and simulator works fine its just when using a physical device. When running pnpm tauri ios dev with a physical device connected and xcode open and listing the device as connected, it shows the connected iphone, loads the app onto the device fine and displays events from the device in the console but on the device it only shows a blank white screen.

I can get the create tauri-app vite solid app to run on device no issues.

What I tried: using TAURI_DEV_HOST in the app.config force-ip-prompt.

Poking around tauri docs uses TAURI_DEV_HOST Doesn't fix it but seems like the v2 approach

Oct 11 11:05:15 firstmate(RunningBoardServices)[1715] <Notice>: Lost inheritances: {( <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:33-34-25808 0> )} Oct 11 11:05:15 firstmate(RunningBoardServices)[1715] <Notice>: Received state update for 1715 (app<com.you.firstmate(475279D8-EFF3-46FB-95FC-1F830DAE868F)>, unknown-NotVisible Oct 11 11:05:16 firstmate[1715] <Error>: Tauri Devtools v2.0.0-rc.0 -> Local: https://devtools.crabnebula.dev/dash/192.168.1.38/3000

Connection failed error Connecting to the specified app failed.

Make sure that your app is running and you are trying to reach it on the correct ip and port.

atilafassina commented 1 month ago

Ohh! Great catch, thanks a lot @iskng I'll work on a PR ASAP!

lucasfernog commented 1 month ago

try running pnpm tauri ios dev --host, that is a requirement for physical devices. (we'll be working on this on the Tauri side to enhance the developer experience)

iskng commented 1 month ago

Still nothing, stock vite build works with or without --host

wireshark shows a get at 3000 with a single 200 response with prefight access-control-request-method

curiously when I had to kill $(lsof -t -i:3000) after it wouldnt shutdown I now get Warn Waiting for your frontend dev server to start

Every other project builds fine, even after restart and completely new quantum project still get this. Desktop version of this stock project works fine.

tried taking out the router and even removing StartServer and just writing html. I can always see the page if i navigate to localhost:3000 but not if I go to my intranet address
No firewall, vpn or proxy on the machine.

If I run vinxi dev —host I can see the page when I go to my intranet address

Now if I add "dev": "vinxi dev --host", to the build script I no longer get waiting for frontend. But black screen on iPhone with error connecting to my intranet ip. Can also access the page on my machine at the intranet address. 



Okay weird built it again and it worked. So it looks like the —host needs to get passed through to vinxi.

It seems that the TAURI_DEV_URL method works because vite will just setup the server at whatever you put in the host config. But for solidstart it doesn't seem to matter whats in the config, unless you specify vinxi dev --host it only maps to localhost which isn't available on device.

@atilafassina seems like the fix for the moment is just add the --host to the build script. I would imagine that solid start would probably want to match the vite config though.

@lucasfernog btw TAURI_DEV_HOST with p tauri ios dev seems to always map to the intranet address even without --host. With p tauri dev its undefined, i think as intended.

lucasfernog commented 1 month ago

I'll see if i can find some time to check this next week