ยทFounder - Thryzor

Getting CORS policy error in Test, Run & Publish mode while invoking API hosted on my local setup

Database & APIs

I have seen a few other questions around this but couldn't find an answer to this issue. To clarify my backend server is running on localhost and I am getting this error while running my App from FlutterFlow in test mode during dev/test period.

My Problem:

Access to fetch at 'http://localhost:8080/countries' from origin 'https://ff-debug-service-frontend-pro-ygxkweukma-uc.a.run.app' has been blocked by CORS policy: Permission was denied for this request to access the unknown address space.

I am not sure what am I missing. I am sweating over this since last 24 hours. Any pointers will be highly appreciated.

Thanks,
Ravi

What have you tried so far?

What I have tried:

I have installed CORS chrome extension and toggled it ON before firing the API. I have also added the ff-debug-service-frontend-pro-ygxkweukma-uc.a.run.app to whitelist. Also added ff-debug-service-frontend-pro-ygxkweukma-uc.a.run.app to Chrome > Local network access > Allowed sites.

But still not able to get past the CORS issue. I have latest Flutterflow updates installed on my system too.

When I invoke 'http://localhost:8080/countries' from FlutterFlow UI > API Calls > <the API> > Response & Test, it works fine. I can see a call in my server logs. But when the same API is invoked through the App in Flutterflow test mode, the API call doesn't seem to reach my server. I see nothing in server logs. It seems like browser in which the Test mode is running is most likely not letting the API call reach server.

Did you check FlutterFlow's Documentation for this topic?
Yes
3
3 replies