Uncaught TypeError in console after 4.2 update
-
Hi,
I’ve just updated the plugin to v4.2, and I’m experiencing this error in the JS console on pages where the plugin is not even used, or better said, pages where the shortcode is not being called.
ytpp-main.js?ver=4.8.1:54 Uncaught TypeError: Cannot read property 'dataset' of null at window.onload (ytpp-main.js?ver=4.8.1:54) window.onload @ ytpp-main.js?ver=4.8.1:54
This brought me to notice that on pages where the playlist shortcode is not being used, still it loads the plugin’s
ytpp-main.js
andstyle.css
file.It would be a good practice if those scripts are queued/added to WordPress pages via the
wp_enqueue_scripts()
action, only when the playlist shortcode is actually present to render a YT playlist.Good to mention that on pages where the shortcode is present, there are no errors and the playlist works as expected.
- The topic ‘Uncaught TypeError in console after 4.2 update’ is closed to new replies.