# Ionic simulator CORS

**URL:** <https://forum.ionicframework.com/t/ionic-simulator-cors/107945>\
**Category:** ionic-v3\
**Created:** [October 6, 2017, 3:58pm UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945 "2017-10-06T15:58:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Balicek](https://avatars.discourse-cdn.com/v4/letter/b/7993a0/32.png) [@Balicek](https://forum.ionicframework.com/u/Balicek)\
**Post date:** [October 6, 2017, 3:58pm UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945/1 "2017-10-06T15:58:44Z")

</div>

Hi everyone, I updated ionic to new version and got problem with CORS. when run simulator or upload my app to real device and call any API I got cors error bellow:

[Error] Failed to load resource: Origin [http://localhost:8080](http://localhost:8080) is not allowed by Access-Control-Allow-Origin. (getOsobniCislaByOrionLogin, line 0)  
[Error] XMLHttpRequest cannot load [https://xxxxxx.com/getOsobniCislaByOrionLogin?login=bal&outputFormat=JSON](https://xxxxxx.com/getOsobniCislaByOrionLogin?login=bal&outputFormat=JSON). Origin [http://localhost:8080](http://localhost:8080) is not allowed by Access-Control-Allow-Origin.  
[Error] Failed to load resource: Origin [http://localhost:8080](http://localhost:8080) is not allowed by Access-Control-Allow-Origin. (diet, line 0)  
[Error] XMLHttpRequest cannot load [http://xxxx.com/diet/](http://xxxx.com/diet/). Origin [http://localhost:8080](http://localhost:8080) is not allowed by Access-Control-Allow-Origin.

so WTF? in simulator and device it should be file:// so why is here now [http://localhost:8080](http://localhost:8080)? Im getting crazy of it…

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [October 6, 2017, 4:50pm UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945/2 "2017-10-06T16:50:05Z")

</div>

Have you got…

```auto
    <access origin="*" />

```

In your config.xml?

Also I think you’re using wkwebview running which is the localhost:8080 as it uses a local web server.

---

<div class="post-metadata">

**Author:** ![Balicek](https://avatars.discourse-cdn.com/v4/letter/b/7993a0/32.png) [@Balicek](https://forum.ionicframework.com/u/Balicek)\
**Post date:** [October 6, 2017, 4:57pm UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945/3 "2017-10-06T16:57:26Z")

</div>

Yes `<access origin="*" />` is there from app installing. I can see you are right when I confirm old config.xml there is new item

`<plugin name="cordova-plugin-ionic-webview" spec="^1.1.14" />`

do you know what is this? But Im pretty sure it destroy my app…

OK so the magic is: ionic cordova plugin rm cordova-plugin-ionic-webview  
I have no idea why is this plugin in my app now. But I can say is resolved now.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [October 6, 2017, 5:37pm UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945/4 "2017-10-06T17:37:20Z")

</div>

[http://blog.ionic.io/wkwebview-for-all-a-new-webview-for-ionic/](http://blog.ionic.io/wkwebview-for-all-a-new-webview-for-ionic/)

How exactly did you update Ionic?

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [October 6, 2017, 6:00pm UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945/5 "2017-10-06T18:00:41Z")

</div>

It’s the wkwebview which is the modern safari engine. It’s better and more performant, leave it there.

---

<div class="post-metadata">

**Author:** ![Balicek](https://avatars.discourse-cdn.com/v4/letter/b/7993a0/32.png) [@Balicek](https://forum.ionicframework.com/u/Balicek)\
**Post date:** [October 6, 2017, 10:43pm UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945/6 "2017-10-06T22:43:10Z")

</div>

Ok, but do you know how to make work ajax? Because when I want to call my API nothing is working (just have to say I can not change this API). So is modern but absolutely useless. So pretty shity plugin I can say…

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [October 6, 2017, 10:47pm UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945/7 "2017-10-06T22:47:13Z")

</div>

> [@Balicek](#):
>
> Origin [http://localhost:8080](http://localhost:8080) is not allowed by Access-Control-Allow-Origin.

Well I would say your API is “shitty” if this can’t be configured. The plugin is doing its job, making sure the data is allowed to be used on this Origin.

---

<div class="post-metadata">

**Author:** ![Balicek](https://avatars.discourse-cdn.com/v4/letter/b/7993a0/32.png) [@Balicek](https://forum.ionicframework.com/u/Balicek)\
**Post date:** [October 6, 2017, 10:52pm UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945/8 "2017-10-06T22:52:36Z")

</div>

Its not my API so I can not choose. BTW in this APP I use two different API’s and non of them support Access Control Allow Origin so that’s fine this plugin is modern but for most of apps is useless. But anyway this is probably my last app in Ionic and next time try Xamarin. All the time there is lots of bugs in Ionic and is annoying.

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [October 6, 2017, 10:57pm UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945/9 "2017-10-06T22:57:39Z")

</div>

Well good luck swapping one set of problems for a new set of problems lol.

If you want to share a repo with us I’ll be happy to take a look, even if you can reproduce the problem in another.

---

<div class="post-metadata">

**Author:** ![jakegibs101](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jakegibs101/32/111488_2.png) [@jakegibs101](https://forum.ionicframework.com/u/jakegibs101)\
**Post date:** [December 8, 2017, 1:00am UTC](https://forum.ionicframework.com/t/ionic-simulator-cors/107945/10 "2017-12-08T01:00:57Z")

</div>

Did you ever figure out the solution?
