Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

210
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!