Describe the bug
Every page of the Interactive Book throws an uncaught TypeError on scroll:
"Cannot read properties of null (reading 'getBoundingClientRect')" at
animateProgressBar. As a result, the reading progress bar at the top of
the page never fills in — it stays stuck at 0% width.
To Reproduce
- Go to 'https://learn.circuitverse.org/docs/binary-representation/binary-numbers.html' (or any page)
- Open DevTools Console
- Scroll down the page
- See error logged on every scroll event
Expected behavior
The progress bar should fill smoothly as the user scrolls, with no console errors.
Desktop:
- OS: macOS
- Browser: Chrome
- Version: [check chrome://version if you want exact number]
Root cause
In _includes/general_scripts.html, document.querySelector('#main-content-wrap')
uses an id selector, but the actual element only has class="main-content-wrap" —
so the query returns null and every scroll throws.
Proposed fix
Change #main-content-wrap to .main-content-wrap in the querySelector call.
Happy to submit a PR for this.
Describe the bug
Every page of the Interactive Book throws an uncaught TypeError on scroll:
"Cannot read properties of null (reading 'getBoundingClientRect')" at
animateProgressBar. As a result, the reading progress bar at the top of
the page never fills in — it stays stuck at 0% width.
To Reproduce
Expected behavior
The progress bar should fill smoothly as the user scrolls, with no console errors.
Desktop:
Root cause
In
_includes/general_scripts.html,document.querySelector('#main-content-wrap')uses an id selector, but the actual element only has
class="main-content-wrap"—so the query returns null and every scroll throws.
Proposed fix
Change
#main-content-wrapto.main-content-wrapin the querySelector call.Happy to submit a PR for this.