Access to fetch at ‘https://api.ipgeolocationapi.com/geolocate’ from origin ‘https://tryfinally-app8df77666989e48db880a9bb85d690abe.sharepoint.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled
This seems to be working fine but as it hits the above URL so it is picking the address of machine which is hosted this end point which is not correct.
So I am not sure how we encounter this, any guidance will be really helpful.
Issue not reproduced for me, I was tested this in SharePoint Online with chrome browser, please let me know the if you can explain the issue reproduce scenario.
Hi,
I am new to sharepoint framework and came across your blog while exploring about the SPFx.
So this webpart seems to be very interesting and i tried to set up it in my local dev.
Here i have tried couple of changes while playing around with this webpart.
I tried to call https://ipgeolocationapi.com/ (https://api.ipgeolocationapi.com/geolocate) which is another API to identify the IP address which seems to be free.
But I am getting below error:
Access to fetch at ‘https://api.ipgeolocationapi.com/geolocate’ from origin ‘https://tryfinally-app8df77666989e48db880a9bb85d690abe.sharepoint.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled
So to encounter this issue I wrapped this with https://cors-anywhere.herokuapp.com/
This seems to be working fine but as it hits the above URL so it is picking the address of machine which is hosted this end point which is not correct.
So I am not sure how we encounter this, any guidance will be really helpful.
Regards
Anand
LikeLike
Hi Anand,
Issue not reproduced for me, I was tested this in SharePoint Online with chrome browser, please let me know the if you can explain the issue reproduce scenario.
LikeLike
Hi i have tried the same weather spfx but its showing different location weather forecast ..pls help me on this
LikeLike
Make sure you are not using VPN or something similar
LikeLike
thank u so much …working fine
LikeLike
i need to develop custom page layouts in my SharePoint online (modern) page. Please help me
LikeLike