Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: error code: XmlHTTPRequest Error

When I run the command flutter run -d chrome --web-port 3000 There I always see an "XMLHttpRequest Error" in Chrome.

Error displayed in terminal

It says:

The OAuth token was not passed to gapi.client, since the gapi.client library is not loaded in your page.

I didn't find any answers here referring to this problem.

Has anybody encountered this problem and been able to solve it?

I attempted all of the methods outlined in another post, How to solve flutter web api cors error only with dart code, but none of them worked for me.

like image 412
uyasd Avatar asked Mar 13 '26 14:03

uyasd


2 Answers

Apparently, the exception is misleading, and if you look at the network traffic, you should see a 403 response from GCP complaining about how the People API is not enabled on the project.

There's a link in the error message to do that, enable the API, wait five minute for the change to propagate, and you should be good.

like image 134
Zalán Meggyesi Avatar answered Mar 15 '26 07:03

Zalán Meggyesi


Just go to Google cloud and inside API navigate to service details and enable People Api It's work for me.

like image 27
Aziz_1 Avatar answered Mar 15 '26 05:03

Aziz_1