Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda