Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type application/json." issue?

I'm currently developing the frontend (VueJS) for a project and to test my login and register logics I'm using laravel as backend, though we'll be actually working with springboot for backend. I was coding in a desktop and everything was normal. So I just started to work with my laptop. I got the same project, everything is equal. When I use postman to make the requests, it works normally, but when I try to make them with the form from my website, I get that error.

I've looked everywhere but couldn't fix it. Nothing I tryed did work. And It seems that no one else had a similar problem.

Cross-Origin Read Blocking (CORB) blocked cross-origin response http://127.0.0.1:8000/api/login with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.

like image 282
Thalys Menezes Avatar asked Feb 15 '19 01:02

Thalys Menezes


1 Answers

Add proxy configuration in vue.config.js file

module.exports = {
  devServer: {
    proxy: 'http://localhost:4000'
  }
}

This will tell the dev server to proxy any unknown requests (requests that did not match a static file) to http://localhost:4000.

here is a link to the doc for more detail

like image 144
Bereket Belete Avatar answered Oct 13 '22 21:10

Bereket Belete