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

106
Visualizações
await is only valid in async functions and the top level bodies of modules

trying to make a chrome extension that scrapes a website but it always scapes it before the content is fully loaded (tried after document read thing in manifest.json)

everytime that is getting called I am getting:

await is only valid in async functions and the top level bodies of modules
const sleepz = (ms = 0) => {
    return new Promise(r => setTimeout(r, ms));
};

const finsh_minting_shit = async(profile,user_id_now) => {
  console.log("das huhn hat ein ei gelegt");
  await sleepz(4000);
  console.log("RuehrEi")
});

window.onload = function() {
  finsh_minting_shit(profile,user_id_now);
}

also tried:

await finsh_minting_shit(profile,user_id_now);
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

const sleepz = (ms = 0) => {
    return new Promise(r => setTimeout(r, ms));
};

const finsh_minting_shit = async(profile,user_id_now) => {
  console.log("das huhn hat ein ei gelegt");
  console.log("RuehrEi")
});

window.onload = function() {
  await sleepz(4000);
  finsh_minting_shit(profile,user_id_now);
}
about 4 years ago · Juan Pablo Isaza Relatório
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