0

i am getting Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type application/json.

SyntaxError</b>: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Response.Body.json (http.js:1091)
    at MapSubscriber.project (auth.service.ts:29)
    at MapSubscriber._next (map.js:79)
    at MapSubscriber.Subscriber.next (Subscriber.js:93)
    at CatchSubscriber.Subscriber._next (Subscriber.js:129)
    at CatchSubscriber.Subscriber.next (Subscriber.js:93)
    at TimeoutSubscriber.Subscriber._next (Subscriber.js:129)
    at TimeoutSubscriber._next (timeout.js:132)
    at TimeoutSubscriber.Subscriber.next (Subscriber.js:93)

Is there any way to bypass this?

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
fiverr freelancer
  • 145
  • 1
  • 3
  • 7
  • 1
    Possible duplicate of [Handling CORS Issues in Ionic](https://stackoverflow.com/questions/41861105/handling-cors-issues-in-ionic) – Jaykant Feb 20 '19 at 10:42

2 Answers2

1

If you are using Chrome for testing your application then you can use CORS for bypass. And if you are testing on your phone then your app must be running on localhost:port_number rather then file://app_location. There is a plugin name ionic webview that will run your application as a website in your applicaion. You must remove Ionic WebView plugin to fix this issue in Mobile app.

ZearaeZ
  • 899
  • 8
  • 20
0

To Solve the problem of corb issue in ionic. In server end you need to add Access-Control-Allow-Origin type in the header. Furthermore please check this screenshot and make changes according to your backend platform

Add

Suraj Bahadur
  • 3,730
  • 3
  • 27
  • 55