Theme error in console with multiple themes
-
I created an application on cloudways.com with only WordPress 5.6.2 installed. In addition, I installed the plugin LearnDash for managing a course platform. Using LearnDash I created what in LearnDash is called a Lesson.
Opening the created Lesson page, I have the following error in the console:
https://i.ibb.co/XxgvX3t/console.gifUncaught TypeError: Cannot read property ‘querySelector’ of null
at n (frontend.min.js?ver=3.0.2:1)
at frontend.min.js?ver=3.0.2:1It points to
/wp-content/themes/twentytwentyone/assets/js/primary-navigation.js?ver=1.1
.The error points to this line in that file:
document.getElementById( 'site-navigation' ).querySelectorAll( '.menu-wrapper > .menu-item-has-children' ).forEach( function( li )
where
getElementById
isnull
.Or see line 170 on this site: https://wpseek.com/source/wp/latest/nav.html?wp-content/themes/twentytwentyone/assets/js/primary-navigation.js.source.html
When I switched to the free Astra theme, a similar error is there (but because of the minified version more difficult to read) where
querySelector
isnull
for:if(void 0===e){if(!(d=i.querySelector("#ast-mobile-header"))
I contacted LearnDash support but they say it doesn’t appear to be an error caused by Learndash.
Any idea what is causing this error?
- The topic ‘Theme error in console with multiple themes’ is closed to new replies.