Problem
document is not defined issue on page, where TableOfContent used.

Examples
Root component
<TableOfContents items={items} showIcons={false} heading={heading} openItems={[]} />
TableOfContent item content
<Anchor
href={`#${item.slug}`}
onClick={(e) => {
e.preventDefault();
closeModal();
const targetElement = globalThis.document?.getElementById(item.slug);
targetElement?.scrollIntoView({ behavior: 'smooth' });
}}
>
{item.title}
</Anchor>
Project
"next": "15.5.7",
"@tedi-design-system/core": "3.0.0",
"@tedi-design-system/react": "14.2.1"