Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49258

Is there really no way to make HTTP calls when testing an ionic React app with "ionic serve"

$
0
0

When developing an ionic React app and using ionic serve to preview the app in a browser, all non-GET HTTP calls fail due to CORS issues. From my research I learned that this is expected behaviour due to cross origin requests from my localhost to an API server.

When running the app inside an emulator or on a physical device the Capacitor HTTP plugin solves those issues, but HTTP calls still won’t work when the app is running locally and viewed in a browser.

The only viable option to overcome this issue seems to be a proxy as described in this ionic tutorial. However, this does not seem to work anymore, since any proxy setup in ionic.config.json will simply be ignored and HTTP calls to the proxy endpoint will just result in a 404 error.

This effectively means that there is no option to use the ionic serve command during app development or to preview a functional web app altogether.

Am I missing something here, or is this just the (very frustrating) state of affairs right now?
Thanks in advance for any help!

6 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 49258

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>