• Resolved Martin Taylor

    (@docdunning)


    I’m seeing this error when I try out the new V5 month view.
    Uncaught TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Object.obj.setContainerClasses (breakpoints.js?ver=5.0.0.1:1)
    at Object.obj.initTasks (breakpoints.js?ver=5.0.0.1:1)
    at Object.obj.setup (breakpoints.js?ver=5.0.0.1:3)
    at <anonymous>:4:41
    at t.activateScript (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at HTMLScriptElement.<anonymous> (rocket-loader.min.js:1)

    The cause appears to be that there is a script on the page, which starts:

    <script type=”application/ld+json”>
    [{“@context”:”https://schema.org&#8221;,”@type”:”Event”,”name”: ….

    When I manually remove this script from the page, the JS error no longer occurs.

    Seems to be a conflict between this script:

    <script class=”tribe-events-breakpoints” type=”ea309bd93536031b5cb9508c-text/javascript”>
    if ( ‘undefined’ !== typeof window.tribe ) {
    var scripts = document.getElementsByTagName( ‘script’ );
    window.tribe.events.views.breakpoints.setup( scripts[ scripts.length – 1 ] );
    }
    </script>

    and the LD+JSON script if it’s on that page. I can comment out either of them and the errors go away.

    Any idea how this error can be avoided?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Martin Taylor

    (@docdunning)

    OK, so I’ve found that the problem is caused by the “Upcoming Events” widget. It has an option to “Generate JSON-LD data”. If that is checked, then it causes an error in breakpoints.js. If I uncheck the option, then no JS error.

    This does look like a compatibility issue for Modern Tribe to investigate, given that it’s between two of the plugin’s components.

    Plugin Author Gustavo Bordoni

    (@bordoni)

    Hi @docdunning,

    Thanks so much for the amount of information you are providing us here and on some other forum threads, it’s really helpful to have debug information so we can pinpoint problems and fix.

    I will make sure this is fixed from our side of things, but the bug is not specifically on our code, it’s on WPRocket Minification of the Scripts.

    It seems like it’s try to use the incorrect Script data for what it needs to do.

    Thanks again,

    my best Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘JavaScript error on new month view’ is closed to new replies.