Ionic 7 capactitor - ERR_CONNECTION_REFUSED (CORS)

Ok, so if you are on a physical device, you would have to use the FQDN or IP address of your computer instead of localhost and open up the port as I mentioned before. Also, the physical device would need to be on the same network as your computer.

For example, if your computer’s IP is 192.168.1.10 then http://192.168.1.10:8080.

Another option would be to use https://ngrok.com or https://expose.dev.