When running your expo app and trying to connect to localhost via an app simulator, the simulator itself has no localhost access.
Updating your API URL to use your devices local ip address still does not work as wragler dev runs on localhost which you would think it would be associated with 127.0.0.1, or 0.0.0.0 or you devices IP address but it does not. It is strictly localhost
This proposed change allows it to run on all local ip address which will allow the EXPO_PUBLIC_API_URL to actually work.
Also without this proposed change all you get on your TRCP calls is this
WARN [TRPCClientError: Network request failed]
With the proposed change you can get this
[wrangler:inf] Ready on http://0.0.0.0:8787
[wrangler:inf] - http://127.0.0.1:8787
[wrangler:inf] - http://10.0.0.135:8787
[wrangler:inf] - http://192.168.64.1:8787
[wrangler:inf] - http://10.0.0.21:8787
[wrangler:inf] GET /trpc/hello.world,auth.secretMessage 207 Multi-Status (25ms)
[wrangler:inf] GET /trpc/auth.secretMessage 401 Unauthorized (12ms)
Issue
When running your expo app and trying to connect to localhost via an app simulator, the simulator itself has no localhost access.
Updating your API URL to use your devices local ip address still does not work as
wragler dev
runs on localhost which you would think it would be associated with127.0.0.1
, or0.0.0.0
or you devices IP address but it does not. It is strictlylocalhost
This proposed change allows it to run on all local ip address which will allow the
EXPO_PUBLIC_API_URL
to actually work.Also without this proposed change all you get on your TRCP calls is this
With the proposed change you can get this