Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

[BUG] Light/Dark theme changes cause JS errors #110

Open
fmueller opened this issue Jun 4, 2021 · 1 comment
Open

[BUG] Light/Dark theme changes cause JS errors #110

fmueller opened this issue Jun 4, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@fmueller
Copy link

fmueller commented Jun 4, 2021

Describe the bug

I recognized my browser console being polluted by JS errors when I changed from light to dark theme, back and forth. Error in the console is: "Uncaught TypeError: window.REMARK42.changeTheme is not a function". It looks like you want to switch to a light/dark theme at Remark42 comment solution as well. But I do not use it.

I was able to hotfix this with a custom script that defines an empty function and mimics Remark42:

window.REMARK42 = {

    changeTheme: function (anything) {
        // do nothing
    }
}

Expected behavior

No JS errors when there is no Remark42 used and I click on 'change to the light/dark theme'.

Build Environment

  • OS: macOS
  • Theme version/commit e0d0b4a
  • Hugo version 0.83.1+extended

Preview Environment

  • OS: macOS
  • Browser Chrome
@fmueller fmueller added the bug Something isn't working label Jun 4, 2021
@uPagge
Copy link
Owner

uPagge commented Jun 4, 2021

Thanks for the find, I will fix it soon

@uPagge uPagge self-assigned this Jun 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants