diff --git a/assets/js/hugo_cookie_consent/cookie_consent.js b/assets/js/hugo_cookie_consent/cookie_consent.js index 2573f97..b359e6e 100644 --- a/assets/js/hugo_cookie_consent/cookie_consent.js +++ b/assets/js/hugo_cookie_consent/cookie_consent.js @@ -1,7 +1,14 @@ (function () { var KEY = 'cookie_consent'; var banner = document.getElementById('cookie-banner'); - if (!banner) return; + if (!banner) { + console.error( + '[hugo_cookie_consent] #cookie-banner not found in the DOM. ' + + 'Did you include the hugo_cookie_consent/banner.html partial in your site\'s layout? ' + + 'See the module README ("Installation in your Hugo site").' + ); + return; + } updateStatus(); var consent = localStorage.getItem(KEY);