• It can be difficult to code on a mobile device, but when someone like Bcworkz is present, he has been quite helpful!

    There are no JavaScript reporting issues when our website is rendered using Google Console Website ( https://search.google.com/test/rich-results ) with desktop method, but we run into these two issues when we render using Google mobile. Here are the two problems we encountered:

    Uncaught TypeError: Cannot set properties of null (setting ‘checked’)

    Uncaught TypeError: Cannot read properties of null (reading ‘style’)

    Will it be challenging to solve this one?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Anonymous User 9588789

    (@anonymized-9588789)

    but we run into these two issues when we render using Google mobile

    The errors exist regardless of the device or browser.

    Uncaught TypeError: Cannot set properties of null (setting ‘checked’)

    Caused by:

    document.getElementById("switch").checked = false;

    Because there is no element in your source with an ID of “switch”.

    The real solution is to fix or remove the JavaScript but if you can’t do that for whatever reason, an empty <span> tag with an id of “switch” in your content would eliminate the first error without any visible effect to the user:

    <span id="switch"></span>

    Uncaught TypeError: Cannot read properties of null (reading ‘style’)

    Caused by:

    document.querySelector(".site-title a").style.color = '#blank';

    Because you have no tag in your source with a class of “site-title” followed by any links.

    Again, the real solution is to remove or fix the JavaScript but if you can’t do that for whatever reason, an empty <span> tag with a class of “site-title” with an empty a tag/link in your content would eliminate the error without any visible effect to the user:

    <span class="site-title"><a href="#"></a></span>
    • This reply was modified 1 year, 4 months ago by Anonymous User 9588789.
    • This reply was modified 1 year, 4 months ago by Anonymous User 9588789.
    Thread Starter salave

    (@salave)

    Hello @anthonybartoli . I believe that adding an empty Span will work great, however the location of these Javascript is my concern. I entirely developed the idea while backing up any adjustments I made to get where I am. I have attached the theme in the hopes that a reupload that I will receive from you will simplify things.

    [download link removed by moderator]

    Anonymous User 9588789

    (@anonymized-9588789)

    I don’t see the problematic JavaScript in your theme files. I also activated it on a default WP site and still don’t see it when loading the homepage (some JS is generated dynamically). It is likely being generated from a plugin.

    • This reply was modified 1 year, 4 months ago by Anonymous User 9588789.
    Anonymous User 9588789

    (@anonymized-9588789)

    It is most likely coming from https://www.ads-software.com/plugins/seo-by-rank-math/. If you deactivate that plugin you should see the error go away.

    • This reply was modified 1 year, 4 months ago by Anonymous User 9588789.
    Thread Starter salave

    (@salave)

    I apologies for the delay in responding, however it is comforting to know that the javascript issues are not related to the theme. How am I going to use a SEO plugin now? What do you recommend I try using Yeost plugin?

    Thread Starter salave

    (@salave)

    The Homepage description won’t remain fixed, which is one of the consequences I took into account when determining whether to remove Rathmath. It will be good to uninstall Rankmath after you help us with a sample that enables us to enter the Home description, and has all other pages echo the excerpt (is_single)

    That way we can proceed and install IndexNow plugin and re-enable Wp sitemap.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Render mobile issues’ is closed to new replies.