javascript functions.bundle.js error when selecting transparent header

2 replies · opened Nov 27, 2024

LleofabianiNov 27, 2024

Hello,
on website the header is setup as per insstructions :
<header id="header" class="full-header border-full-header header-size-sm dark static-sticky transparent-header" data-mobile-sticky="true" data-sticky-shrink="true" data-sticky-class="" data-sticky-offset="0" data-sticky-offset-negative="auto" >

when loading page i get error (??) :
oncaught TypeError: Cannot read properties of null (reading 'querySelector')
at _swiper (functions.bundle.js?v=241127:2320:48)
at Object.init (functions.bundle.js?v=241127:2398:6)
at Object.sliderMenuClass (functions.bundle.js?v=241127:784:50)
at HTMLDivElement.<anonymous> (?v=294325476:575:20)
at HTMLDivElement.dispatch (plugins.min.js?v=241127:1:39485)
at f.handle (plugins.min.js?v=241127:1:37482)
at Object.trigger (plugins.min.js?v=241127:1:69087)
at HTMLDivElement.<anonymous> (plugins.min.js?v=241127:1:69680)
at Function.each (plugins.min.js?v=241127:1:3065)
at S.fn.init.each (plugins.min.js?v=241127:1:1563)

here the query selector in functions.bundle.js
(i don't use swiper on website)
see below the eroor parsing javascript file above.
it only happens if selecting transparent header with class
best regards

SliderMenuClass: function() {
var _swiper = function() {
if( !__core.getVars.elHeader.classList.contains('ignore-slider') && ( __core.getVars.elBody.classList.contains('is-expanded-menu') || ( __core.getVars.elHeader.classList.contains('transparent-header-responsive') && !__core.getVars.elBody.classList.contains('primary-menu-open') ) ) ) {
-------------->>> var activeSlide = __core.getVars.elSlider.querySelector('.swiper-slide-active');<------------ERROR HERE
_schemeChanger(activeSlide);
}
};

LleofabianiNov 30, 2024

I found the error, rgb values were empty giving the error.
suggestion, the script should have control over empty variables giving console error if not set and not block whole page.

SSemicolon WebSTAFFMar 5, 2025

Hello,

Apologies for the Inconveniences caused!

We will definitely look into this but it would be great if you can please provide us with a Live URL with the error so that we can check out the exact issue and provide you with more accurate assistance on this. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard