Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

160
Visualizações
error "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"

I have a async function with a fetch call to an api , in Safari the function works fine with no errors, but in Chrome and Firefox I get the following error:

"SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"

I think it has something to do with the json response not being readable, but I was not sure how to fix this inside of the following function :

async function getUserTracks() {
    try {
      await fetch("https://www.soundpro.city/music/music_all/?format=json") 
        .then(res => res.json())
        .then(data => {
          for (item of data)
            trackNames.push(item['title']),
            trackUrl.push(item['track']),
            albums.push(item['artist_name'])
        })
    } catch(error) {
      console.log(error)
    }
}
getUserTracks();
console.log(trackNames, trackUrl, albums);
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda