Whenever i tried to fetch it returned an error TypeError:failed to fetch others solution doesnt to work for me. Here's my code
fetch(url)
.then((resp) => resp.json())
.then((data) => {
this.JSONData = data;
})
.then(() => {
this.search()
})
.catch(error => {
alert(error);
});