boopathikumar018 / docsify-darklight-theme

A Dark and Light theme with switch for your docsify site
https://docsify-darklight-theme.boopathikumar.me
MIT License
142 stars 50 forks source link

Uncaught TypeError: document.getElementById(...) is null #14

Closed Garinmckayl closed 3 years ago

Garinmckayl commented 3 years ago

the plugin is working flawlessly most of the time, but once in a every couple of times the plugin is messing the other plugins that i am using like tab. so they will stop working completely. but this plugin works fine

edufschmidt commented 3 years ago

I'm observing the same behavior. Have you managed to find a workaround?

edufschmidt commented 3 years ago

Update: adding a null check on line 112 of the file docs/js/index.js does the trick:

const el = document.getElementById('docsify-darklight-theme')

if (el !== null) {
    el.addEventListener('click', function() { ... })
}
Garinmckayl commented 3 years ago

yeah, that does the trick

boopathikumar018 commented 3 years ago

Added the fix in version: 3.1.4