• Resolved josh.grisdale

    (@joshgrisdale)


    Hello,

    I am getting the above error from some sites I have to maintain. Can you please send the link for me to send error logs please?

    Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support James Osborne

    (@jamesosborne)

    Thanks for reaching out @joshgrisdale. As we’re investigating reports of this specific error please share the following which may hopefully help us determine the cause:

    1. Your Site Health information. You can use this form to share privately if preferred. 
    2. Does this error appear consistently for you, on the Site Kit main dashboard, on the Site Kit widget on the main WordPress dashboard, or when using the Site Kit admin toolbar?
    3. When checking the Site Kit dashboard from a Chrome browser incognito window does the same occur? If so, please share any browser console errors that appear.?

    Let me now if you have any questions with the above.

    Thread Starter josh.grisdale

    (@joshgrisdale)

    Hi

    It is happening on numerous sites I run. I submitted the errors from two in the private form. (I have two other sites where it is fine.)

    It is fine when in the main dashboard, it only occurs from the admin par when looking at a page.

    It occurs in incogneto window as well.

    Looking at the consol errors:

    Error: An error occurred while running 'mapSelect': Cannot read properties of null (reading 'isGA4DashboardView')
    The error may be correlated with this previous error:
    TypeError: Cannot read properties of null (reading 'isGA4DashboardView')
        at Object.current (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-adminbar.min.js:2:6992)
        at e (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:543780)
        at https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:543887
        at Ii (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:866408)
        at Ji (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:866511)
        at Sj (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:884459)
        at t.unstable_runWithPriority (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:903782)
        at Hr (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:828235)
        at Jj (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:880929)
        at wa (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:877081)
    
    Original stack trace:
        at y (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:543575)
        at AdminBarWidgets (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-adminbar.min.js:2:6964)
        at Fo (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:841129)
        at ii (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:849990)
        at Ti (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:888604)
        at Qj (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:879929)
        at Kj (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:879854)
        at wa (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:876882)
        at https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:828526
        at t.unstable_runWithPriority (https://hoikuen.azalee.or.jp/wp-content/uploads/siteground-optimizer-assets/googlesitekit-vendor.min.js:1:903782)

    If I deactivate Siteground Optimizer (which is on all the sites with errors, but not on the sites without errors), it doesn’t have an error. So, it seems to be that plugin…

    Plugin Support James Osborne

    (@jamesosborne)

    Great to know that this once occurs in the admin toolbar, thanks for sharing. In that case, based on your very useful troubleshooting with Siteground Optimizer, I’ll perform some checks using the same, while leaving notes on the related GitHub issue. I’ll report back to you here once I have an update.

    Plugin Support James Osborne

    (@jamesosborne)

    Thanks for your patience on this @joshgrisdale. I’ve been performing some tests with SG Optimizer and Site Kit. In my case with Site Kit 1.102.0 and also 1.104.0 I don’t encounter the same error using the admin toolbar feature of Site Kit. Based on tis it may require some further checks.

    To start checking for any particular configuration that may be impacting your Site Kit admin toolbar feature, can you share whether you have any Frontend > Javascript features enabled, such as minification or combining of JavaScript files? If so please disable before checking once more.

    Thread Starter josh.grisdale

    (@joshgrisdale)

    Yes they were enabled.

    I turned them all off and it worked fine.

    I then turned them on one by one, and the error only happens when Minify Javascript is on. (Combining and deferring javascript is fine). It was reproducible with other the other sites i was getting the error on as well.

    Hope this helps!

    Plugin Support James Osborne

    (@jamesosborne)

    Thanks for the update @joshgrisdale. Minification can indeed cause such issues, and we are aware of such errors when using other optimization type plugins. The errors output are not the same, however, it’s useful to know and inform users when they do arise.

    To ensure you no longer encounter this error, can you apply the below to the exclude option within SH Optimizer and share whether the same occurs with minification enabled?
    /wp-content/plugins/google-site-kit/

    Note that in this exclude option Site Kit was not available for me, however, I believe it has a detection feature so in your case it may determine any Site Kit JavaScript resources.

    If you don’t see a Site Kit option, or if the same occurs after you do add Site Kit to the exclude option, please click on the “General” tab next to JavaScript and add the Site Kit directory to the exclude option for HTML minification before checking the Site Kit admin toolbar once more.

    Let me know how you get on with the above.

    Thread Starter josh.grisdale

    (@joshgrisdale)

    Hello,

    Site Kit did not come up in the list for JavaScript to exclude for me.

    I added it in the HTML Minification excluded directories, but the error remains.

    Thanks!

    Plugin Support James Osborne

    (@jamesosborne)

    Thanks for the update @joshgrisdale. Based on what you’re encountering this isn’t unexpected given what minification can do. I performed some checks with SG Optimizer and while I don’t encounter the same I did see there is an exclusion filter that can be applied for plugins (see here).

    In order to test this on your site, can you add the below to a custom functions plugin, or a child themes functions.php file? After doing so, please check does the same error appear.

    add_filter( 'sgo_js_minify_exclude', 'js_minify_exclude' );
    function js_minify_exclude( $exclude_list ) {
    $exclude_list[] = 'googlesitekit-runtime';
    $exclude_list[] = 'googlesitekit-i18n';
    $exclude_list[] = 'googlesitekit-vendor';
    $exclude_list[] = 'googlesitekit-data';
    $exclude_list[] = 'googlesitekit-datastore-forms';
    $exclude_list[] = 'googlesitekit-datastore-location ';
    $exclude_list[] = 'googlesitekit-datastore-site';
    $exclude_list[] = 'googlesitekit-datastore-user';
    $exclude_list[] = 'googlesitekit-datastore-ui';
    $exclude_list[] = 'googlesitekit-widgets';
    return $exclude_list;
    }

    If you’re unsure on the above I can put this into a custom mini plugin.

    Let me know if you have any questions with the above.

    Thread Starter josh.grisdale

    (@joshgrisdale)

    Hello,

    I added that to functions.php but there was no change to the error.

    Best,
    Josh

    Plugin Support James Osborne

    (@jamesosborne)

    Sorry to hear that @joshgrisdale. In that case you’ll need to reach out to the SG Optimizer team in order to query on how to exclude certain resources from minification. As with other plugins, minificiation on the front end can impact the Site Kit admin toolbar. We have a section on some of the more common errors that can be encountered with the Site Kit admin toolbar added to the plugin website.

    Note also that as this appears only with the admin toolbar, it’s only visible to you and other administrators, and not regular visitors to your site. Another possibility you can ask the SG Optimizer team is to disable minification for administrators, which would be another solution.

    Let me know if you have any further queries with the above.

    Thread Starter josh.grisdale

    (@joshgrisdale)

    Thank you very much for sticking with me on this. Yeah, only a mild inconvenience. I can always just turn off minification for a few minutes if need be.

    Thanks again!

    Plugin Support James Osborne

    (@jamesosborne)

    No problem. Thank you for helping us determine the cause of this error specifically, in particular as it arose before and we were unable to recreate this.

    Be sure to reach out if you have any further queries, and if you have a moment free consider sharing your thoughts on the plugin as a user for some time.

    Best of luck.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘TypeError: Cannot read properties of null (reading ‘isGA4DashboardView’)’ is closed to new replies.