# Error when clicking on the homepage logo

**URL:** <https://meta.discourse.org/t/error-when-clicking-on-the-homepage-logo/306644>\
**Category:** Development\
**Created:** [May 3, 2024, 12:38pm UTC](https://meta.discourse.org/t/error-when-clicking-on-the-homepage-logo/306644 "2024-05-03T12:38:35Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![ogulcan1787](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ogulcan1787/32/128589_2.png) [@ogulcan1787](https://meta.discourse.org/u/ogulcan1787)\
**Post date:** [May 3, 2024, 1:04pm UTC](https://meta.discourse.org/t/error-when-clicking-on-the-homepage-logo/306644/7 "2024-05-03T13:04:57Z")

</div>

> [@Arkshine](#):
>
> You might take a look at your recent customizations.

```plaintext
<script>
function moveTagsToTitle() {
    const mainLinks = document.querySelectorAll('.main-link');
    mainLinks.forEach(mainLink => {
        const discourseTags = mainLink.querySelector('.discourse-tags');
        const titleElement = mainLink.querySelector('.title');

        if (discourseTags && titleElement) {
            const tags = discourseTags.querySelectorAll('.discourse-tag');

            tags.forEach(tag => {
                const tagSpan = document.createElement('span');
                tagSpan.className = 'discourse-tag box';
                tagSpan.textContent = tag.textContent;
                tagSpan.style.fontSize = 'var(--font-down-2)';
                tagSpan.style.borderRadius = '10px';
                tagSpan.style.border = '1px solid #444460';
                tagSpan.style.backgroundColor = '#1f1f33';
                tagSpan.style.margin = '2px';
                tagSpan.style.display = 'inline-block';
                tagSpan.style.overflow = 'hidden';
                tagSpan.style.whiteSpace = 'nowrap';
                tagSpan.style.textOverflow = 'ellipsis';
                tagSpan.style.verticalAlign = 'middle';
                tagSpan.style.marginRight = '5px';
                tagSpan.style.marginLeft = '-6px';
                titleElement.insertBefore(tagSpan, titleElement.firstChild);
            });

            if (discourseTags.parentNode) {
                discourseTags.parentNode.removeChild(discourseTags);
            }
        }
    });

    const topicHeaderExtras = document.querySelectorAll('.topic-header-extra');

    topicHeaderExtras.forEach(topicHeaderExtra => {
        const discourseTags = topicHeaderExtra.querySelector('.discourse-tags');
        const tags = discourseTags.querySelectorAll('.discourse-tag');

        tags.forEach(tag => {
            tag.className = 'discourse-tag box';

            tag.style.borderRadius = '10px';
            tag.style.border = '1px solid #444460';
            tag.style.backgroundColor = '#1f1f33';
            tag.style.margin = '1px';
            tag.style.padding = '2px 8px';
            tag.style.display = 'inline-block';
            tag.style.overflow = 'hidden';
            tag.style.whiteSpace = 'nowrap';
            tag.style.textOverflow = 'ellipsis';
            tag.style.verticalAlign = 'middle';
            tag.style.marginRight = '5px';
            tag.style.marginBottom = '5px';
        });
    });
}

window.addEventListener('load', moveTagsToTitle);
const observer = new MutationObserver(moveTagsToTitle);
const targetNode = document.body;
const observerOptions = {
    childList: true,
    subtree: true
};
observer.observe(targetNode, observerOptions);
</script>

```

These codes cause this error.  
I don’t know how can I fix.  
I need these codes ☹

---

_[View the full topic](https://meta.discourse.org/t/error-when-clicking-on-the-homepage-logo/306644)._
