Question: I keep getting the error "the string did not match the expected pattern" for my fetch requests. I've seen some people having similar problems on here and other forums but can't pinpoint the problem.

What is the cause of the error?

```js
function showRecipes(){
    const ingredients = document.getElementById('ingredients').value.replace(/\s/g, "");
    const meal = document.getElementById('meal').value;
    const display = document.getElementById('display'); //Where results will go

    let url = 'http://www.recipepuppy.com/api/';
    url += `?i=${ingredients}&q=${meal}`;

    fetch(url, { mode: "no-cors"})
        .then(response => {
            response.json()
                .then(data => {
                    data.results.forEach(recipe => {
                        const container = document.createElement('div');
                        container.setAttribute('class', 'container');

                        const h1 = document.createElement('h1');
                        h1.textContent = recipe.title;

                        const p = document.createElement('p');
                        p.textContent = recipe.ingredients;

                        display.appendChild(container);
                        container.appendChild(h1);
                        container.appendChild(p);
                    })
                })
                .catch(err => {
                    console.log(err);
                })
        })
        .catch(err => {
            console.log('ERROR: ' + err);
        })
}

```

Answer: 
For those receiving this, and also perhaps debugging their code and finding an HTTP Response object containing information which does not match the information given in the developer tools, this is problem is created by `no-cors`. Remove `no-cors`, and you won't have this problem.
### An updated example with async/await related to [this answer](https://stackoverflow.com/a/65638007/1705829):

```
async function index() {
  var res2 = await fetch('url with text response')

  // res2 is in json format <-- not valid here, see error above in the question
  // var res = await res2.json()

  // res2 is in text format <-- valid here
  var res = await res2.text()
}

```