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

211
Visualizações
Click on HTML button throw a Uncaught TypeError: Cannot read properties of null (reading 'length')

I'm quite a JS nob and this might be a very stupid question.

Via the chrome dev tool console, I'm trying to click on a "show more" button that I have on the page I'm visiting (https://www.capterra.com/account-based-marketing-software/):

document.getElementsByClassName('Button__CenteredText-sc-2779at-4')[0].click();

The click loads more results into the page and that is what I would expect.

However, as soon as the line of code runs, the console throws a:

Uncaught TypeError: Cannot read properties of null (reading 'length')
at forEach (/directoryPage/assets/webpack:/src/ui/app/gtm-client.js:32)
at Array.forEach (<anonymous>)
at initializePayload (/directoryPage/assets/webpack:/src/ui/app/gtm-client.js:31)
at Object.transmitToDataLayer (/directoryPage/assets/webpack:/src/ui/app/gtm-client.js:48)
at /directoryPage/assets/webpack:/src/ui/app/components/PageContainer/LayoutContainer.js:260

I have tried to wrap my click call around a try..catch, but the error keeps popping up.

Does anyone have any idea about the possible cause for this error?

Thanks! Alessio

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The error shown in the console seems not to be related to the line of code that you posted. Try to put a breakpoint in the line where forEach is executed to see why the value is null.

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