If skipRendering is true tocbot throws following error:
build-html.js:199 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'querySelector')
at Object.updateToc (build-html.js:199:41)
at Object.<anonymous> (index.js:197:17)
at Object._scrollListener (index.js:79:12)
at tocbot.init (index.js:207:10)
at AsyncFunction.OnThisPage_component_useVisibleTask_JUUUE8xYwDo [as resolved] (on-this-page.tsx:106:12)
at AsyncFunction.invoke (use-core.js:59:26)
at qrl-class.js:70:35
at then (promises.js:20:56)
at qrl-class.js:56:20
at use-task.js:439:27
It throws this error in this line
var oldActiveTocLink = tocElement.querySelector('.' + options.activeLinkClass)
It seems tocElement is undefined, however I am sure it is defined and I can see it successfully resolved in the tocbot.init function.
Hey, thanks for opening this issue! And apologies for my delay in getting back to you.
I have a PR here that should address this. Let me know if that fix doesn't work or if you run into anything else. Thanks!
If
skipRendering
is true tocbot throws following error:It throws this error in this line
It seems
tocElement
is undefined, however I am sure it is defined and I can see it successfully resolved in thetocbot.init
function.Do I miss something? Thanks.