Cross-Origin Read Blocking (CORB) blocked cross-origin response <URL> with MIME type text/html. See <URL> for more details

2.1k Views Asked by At

i keep getting this error "Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type text/html. See for more details."

for the below code any ideas how to solve this please?

 async onSearchSubmit(entry)  {

try {
    const response = await fetch(`https://pixabay.com/api/?key="removed key "&q=${entry}&image_type=photo`)
    if(response.ok) {
        const jsonResponse = await response.json();
        this.setState({images:jsonResponse.hits})
    } else 
      throw new Error("Request Failed!");
} catch (error) {
    console.log(error);
}

}
0

There are 0 best solutions below