• Resolved Marcus

    (@power2009)


    Hi, i back with issues

    Front End Script Error for frontend.min.js type=”module”

    https://ww.wp.xz.cn/support/topic/front-end-script-error-for-frontend-min-js-typemodule/

    https://ww.wp.xz.cn/support/topic/uncaught-syntaxerror-15/

    is not resolved issues in latest version. Your function remains unchanged without the condition I offered you.

    /**
     * Update script tag.
     * The vue code needs type=module.
     */
    public function script_loader_tag( $tag, $handle, $src ) {
    
        if ( ! in_array( $handle, $this->own_handles ) ) {
            return $tag;
        }
    
        // Change the script tag by adding type="module" and return it.
        $html = str_replace( '></script>', ' type="module"></script>', $tag );
    
        $domain = monsterinsights_is_pro_version() ? 'ga-premium' : 'ga-premium';
        $html   = monsterinsights_get_printable_translations( $domain ) . $html;
    
        return $html;
    }

    My fix add line

    // Check if the 'monsterinsights-vue-frontend' script is the target
    if ( 'monsterinsights-vue-frontend' === $handle ) {
    // Remove any existing type attribute
    $tag = str_replace( 'text/javascript', 'module', $tag );
    }

    FULL code

    /**
    * Update script tag.
    * The vue code needs type=module.
    */
    public function script_loader_tag( $tag, $handle, $src ) {
    
        if ( ! in_array( $handle, $this->own_handles ) ) {
            return $tag;
        }
    
        // Check if the 'monsterinsights-vue-frontend' script is the target
        if ( 'monsterinsights-vue-frontend' === $handle ) {
        // Remove any existing type attribute
        $tag = str_replace( 'text/javascript', 'module', $tag );
        }
    
        // Change the script tag by adding type="module" and return it.
        $html = str_replace( '></script>', ' type="module"></script>', $tag );
    
        $domain = monsterinsights_is_pro_version() ? 'ga-premium' : 'ga-premium';
        $html   = monsterinsights_get_printable_translations( $domain ) . $html;
    
        return $html;
    } 
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Marcus

    (@power2009)

    Admin widgets dashboard issues

    vendor-b19955ae.min.js:5 TypeError: t.tablePrepareColumnItems is not a function
    at ReportReAuth-d9fc4de3.min.js:1:38727
    at c.pD as _l
    at c.kt (ReportReAuth-d9fc4de3.min.js:1:38594)
    at RD.e._render (vendor-b19955ae.min.js:5:22157)
    at c.n (vendor-b19955ae.min.js:5:32204)
    at e.get (vendor-b19955ae.min.js:5:28396)
    at e.run (vendor-b19955ae.min.js:5:29133)
    at Mk (vendor-b19955ae.min.js:5:34414)
    at Array. (vendor-b19955ae.min.js:5:25959)
    at uM (vendor-b19955ae.min.js:5:25371)

    vendor-b19955ae.min.js:5 TypeError: t.tablePrepareColumnItems is not a function
    at ReportReAuth-d9fc4de3.min.js:1:38727
    at c.pD as _l
    at c.kt (ReportReAuth-d9fc4de3.min.js:1:38594)
    at RD.e._render (vendor-b19955ae.min.js:5:22157)
    at c.n (vendor-b19955ae.min.js:5:32204)
    at e.get (vendor-b19955ae.min.js:5:28396)
    at e.run (vendor-b19955ae.min.js:5:29133)
    at Mk (vendor-b19955ae.min.js:5:34414)
    at Array. (vendor-b19955ae.min.js:5:25959)
    at uM (vendor-b19955ae.min.js:5:25371)
    6
    vendor-b19955ae.min.js:5 TypeError: t.tablePrepareColumnItems is not a function
    at ReportReAuth-d9fc4de3.min.js:1:38727
    at c.pD as _l
    at c.kt (ReportReAuth-d9fc4de3.min.js:1:38594)
    at RD.e._render (vendor-b19955ae.min.js:5:22157)
    at c.n (vendor-b19955ae.min.js:5:32204)
    at e.get (vendor-b19955ae.min.js:5:28396)
    at e.run (vendor-b19955ae.min.js:5:29133)
    at Mk (vendor-b19955ae.min.js:5:34414)
    at Array. (vendor-b19955ae.min.js:5:25959)
    at uM (vendor-b19955ae.min.js:5:25371)

    The error TypeError: t.tablePrepareColumnItems is not a function indicates that the script is trying to call tablePrepareColumnItems, but this function is either not defined or not available in the current context. Here are some possible reasons and ways to resolve this issue:

    1. Incorrect Import:
      • Make sure you have correctly imported the module or function that contains tablePrepareColumnItems. If you are using ES6 modules, check that there is an appropriate import statement for this function.
    2. Check Script Loading Order:
      • If tablePrepareColumnItems is defined in one of the scripts that load asynchronously or later than when it is called, this could cause the error. Ensure all dependencies are loaded in the correct order.
    3. Function Not Defined or Incorrectly Generated:
      • It’s possible that the function was not generated due to an error in the code or during the compilation process. Check for any other errors in the console that might indicate this.
    Plugin Support Michelle D.

    (@devmich)

    Hi @power2009,

    Thanks for letting us know. I’m sorry for the trouble here.

    Out of curiosity, could you share with me the following:

    • PHP version
    • MonsterInsights version
    • WordPress version

    I’ll be forwarding this issue to our developers to investigate and the above details will be a big help.

    Thank you!

    Thread Starter Marcus

    (@power2009)

    PHP version 8.4.3 / MonsterInsights version 9.2.4 / WordPress version 6.7.1

    Thread Starter Marcus

    (@power2009)

    update 8.3.0 + PHP 8.4.4 + Latest WordPress have issues Issues not fixes! Script Error for frontend.min.js type=”module” you not apply my fix((

    Plugin Support Michelle D.

    (@devmich)

    Hi @power2009,

    Thanks for checking in.

    After further investigation, our developer team has confirmed that a patch, like the one you mentioned, has already been released to address this issue. If you are still experiencing problems, it might be due to a plugin conflict or another configuration in your environment. Our team would be more than happy to take a closer look at this for you.

    Would you be able to reach out to us at https://www.monsterinsights.com/get-help/?

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Issues not fixes! Script Error for frontend.min.js type=”module”’ is closed to new replies.