# \[Solved\] Why do I see “Failed to fetch data. Please test on a device” when using the web API component in live preview (worked on Thunkable live app but not on browser live/preview mode)?

**URL:** <https://community.thunkable.com/t/solved-why-do-i-see-failed-to-fetch-data-please-test-on-a-device-when-using-the-web-api-component-in-live-preview-worked-on-thunkable-live-app-but-not-on-browser-live-preview-mode/1972488>\
**Category:** Questions about Thunkable X\
**Tags:** webapi\
**Created:** [July 23, 2022, 8:57am UTC](https://community.thunkable.com/t/solved-why-do-i-see-failed-to-fetch-data-please-test-on-a-device-when-using-the-web-api-component-in-live-preview-worked-on-thunkable-live-app-but-not-on-browser-live-preview-mode/1972488 "2022-07-23T08:57:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngocddt2f11o](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@ngocddt2f11o](https://community.thunkable.com/u/ngocddt2f11o)\
**Post date:** [July 23, 2022, 8:57am UTC](https://community.thunkable.com/t/solved-why-do-i-see-failed-to-fetch-data-please-test-on-a-device-when-using-the-web-api-component-in-live-preview-worked-on-thunkable-live-app-but-not-on-browser-live-preview-mode/1972488/1 "2022-07-23T08:57:33Z")

</div>

I have searched all the topic about WebAPI component, however, none of the topics found solving my problem so I post it here for sharign the case.  
I used Thunkable webApi component to demo a case of sending web API to my local blynk server.  
The api url was a simple get request using following format  
WebIpi.url = [http://localhost:8041/token/get/v1](http://localhost:8041/token/get/v1)?  
with curl, the response was fine with [“0”] or [“1”] when I change the status of the virtual pin using touch button. however, with thunkable, this failed and the response error was “Failed to fetch data. Please test on a device or contact support”  
I tested similar code block with kodular and it work fine.  
So I finally double that the WebApi component in thunkable was problematic.  
Can Thunkable Devel team help to solve this with thanks.  
Sincerely yours

---

<div class="post-metadata">

**Author:** ![zander](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zander](https://community.thunkable.com/u/zander)\
**Post date:** [July 23, 2022, 11:20am UTC](https://community.thunkable.com/t/solved-why-do-i-see-failed-to-fetch-data-please-test-on-a-device-when-using-the-web-api-component-in-live-preview-worked-on-thunkable-live-app-but-not-on-browser-live-preview-mode/1972488/2 "2022-07-23T11:20:52Z")

</div>

Did you test on the companion app? Also a link to yoir project would be helpful 😀

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 23, 2022, 1:50pm UTC](https://community.thunkable.com/t/solved-why-do-i-see-failed-to-fetch-data-please-test-on-a-device-when-using-the-web-api-component-in-live-preview-worked-on-thunkable-live-app-but-not-on-browser-live-preview-mode/1972488/3 "2022-07-23T13:50:40Z")

</div>

> [@ngocddt2f11o](#):
>
> this failed and the response error was “Failed to fetch data. Please test on a device or contact support”

The message literally says, test it from your phone. Did you do that?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [July 23, 2022, 6:20pm UTC](https://community.thunkable.com/t/solved-why-do-i-see-failed-to-fetch-data-please-test-on-a-device-when-using-the-web-api-component-in-live-preview-worked-on-thunkable-live-app-but-not-on-browser-live-preview-mode/1972488/4 "2022-07-23T18:20:41Z")

</div>

> [@ngocddt2f11o](#):
>
> Failed to fetch data. Please test on a device or contact support

Hey @ngocddt2f11o Welcome to the community. This is a common issue and is due to the settings of the resource you are attempting to access and how api calls are executed from the Thunkable builder. All platforms do these actions slightly different.

Please see this article for more info

[https://intercom.help/thunkable/en/articles/4515338-what-is-the-cors-policy-affecting-my-web-app](https://intercom.help/thunkable/en/articles/4515338-what-is-the-cors-policy-affecting-my-web-app)

---

<div class="post-metadata">

**Author:** ![ngocddt2f11o](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@ngocddt2f11o](https://community.thunkable.com/u/ngocddt2f11o)\
**Post date:** [July 23, 2022, 9:51pm UTC](https://community.thunkable.com/t/solved-why-do-i-see-failed-to-fetch-data-please-test-on-a-device-when-using-the-web-api-component-in-live-preview-worked-on-thunkable-live-app-but-not-on-browser-live-preview-mode/1972488/5 "2022-07-23T21:51:06Z")

</div>

Sorry All from late replying. I and my family went to the countryside and busy with other work then.  
My case was verry simple that I am surely, realize that it was (may be intentionally) a Thunkable drawback vs Kodular orr Mit App, at least on WebApi component. let see the code block:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/8/3896c025cdaa786c00164f68579ea984bc8864fb.png)  
If I changed the response to status or error, the error message appear. Since Thunkable only allow 2 export to Apk per month, I did try to export once but I could not do that successfully, every time I clicked on the link that Thunkable created over email, a screen just popped up and close without nothing.  
The above oode blocked has tested successfully on both Kodular and Mit App via companion.  
Thank you for your attention.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 23, 2022, 9:56pm UTC](https://community.thunkable.com/t/solved-why-do-i-see-failed-to-fetch-data-please-test-on-a-device-when-using-the-web-api-component-in-live-preview-worked-on-thunkable-live-app-but-not-on-browser-live-preview-mode/1972488/6 "2022-07-23T21:56:39Z")

</div>

The thing is you don’t need to compile to APK. You just need to install the Thunkable Companion App and then run your project from it without the need to compile.

---

<div class="post-metadata">

**Author:** ![ngocddt2f11o](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@ngocddt2f11o](https://community.thunkable.com/u/ngocddt2f11o)\
**Post date:** [July 23, 2022, 10:12pm UTC](https://community.thunkable.com/t/solved-why-do-i-see-failed-to-fetch-data-please-test-on-a-device-when-using-the-web-api-component-in-live-preview-worked-on-thunkable-live-app-but-not-on-browser-live-preview-mode/1972488/7 "2022-07-23T22:12:40Z")

</div>

Muneer,  
Thanks for following up! I tested on thunkable live and it worked. Previously I tested all on the web live test and preview mode (all other demo cases were okay).  
So it done, the topic can be closed, but I need to change the topic title first!

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [July 24, 2022, 12:26am UTC](https://community.thunkable.com/t/solved-why-do-i-see-failed-to-fetch-data-please-test-on-a-device-when-using-the-web-api-component-in-live-preview-worked-on-thunkable-live-app-but-not-on-browser-live-preview-mode/1972488/8 "2022-07-24T00:26:07Z")

</div>


