fiverr freelancer
fiverr freelancer

Reputation: 165

CORB ISSUE IN IONIC 3

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?

Upvotes: 0

Views: 945

Answers (2)

Suraj Bahadur
Suraj Bahadur

Reputation: 3928

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

Upvotes: 0

ZearaeZ
ZearaeZ

Reputation: 905

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.

Upvotes: 1

Related Questions