Support » Plugin: WordPress Infinite Scroll - Ajax Load More » Error: Cannot set property ‘opacity’ of undefined

  • Resolved amddtim

    (@amddtim)


    I’ve seen several people having this same sort of issue with the most recent version of the WP core and ALM. Getting “Error: Cannot set property ‘opacity’ of undefined” in the console. While my repeater templates are loading, the javascript callbacks are not firing.

    http://actexpo02.wpengine.com/about

    Let me know what sort of debug info you need to resolve. Thank you!

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author dcooney

    (@dcooney)

    @amddtim can you make sure your repeater template doesn’t have any unclosed HTML elements?

    Also make sure your site cache including css and js is cleared.

    Let me know.

    Thread Starter amddtim

    (@amddtim)

    @dcooney shouldn’t be anything unclosed and the link is a staging site which doesn’t employ caching. Wasn’t working locally either. Hard browser refresh. Everything.

    Out of 6 templates used on that page, they all through errors. Note that the content is actually served (some of the blocks hide it until slick.js can be fired), but the console reflects the errors and the ALM javascript callback functions aren’t firing.

    Plugin Author dcooney

    (@dcooney)

    Hmm, Im not sure what is happening. Could it be the ALM Cache?
    Could you also try it with the transition_container="true"?

    Thread Starter amddtim

    (@amddtim)

    I don’t think it’s the ALM Cache. I turned that off locally and am still getting the same console errors. Also changed to transition_container="true" and transition="fade" on the quote section with no success.

    Let me know if you need any login access.

    Plugin Author dcooney

    (@dcooney)

    I think your issues are in your repeater templates.
    If the error revolves around being unable to set the opacity it means ALM cannot find the element to style.

    THis usually means unclosed or extra closing elements in the templates.

    I’d start testings by doing the following:

    1. Turn off the cache
    2. Make sure each repeater template has an opening and closing element. <div>...</div>
    3. Start with a single ALM instance until you get that working.

    Hope that helps.

    Thread Starter amddtim

    (@amddtim)

    • Turned off cache and removed the cache parameters from the shortcode
    • Removed all ALM instances except for the quote block
    • Added a <div> wrapper to the entire quote block repeater template

    Still getting the console error: http://actexpo02.wpengine.com/about

    Plugin Author dcooney

    (@dcooney)

    The error is different now.
    Error: Cannot read property 'data' of undefined
    And I can see the post returned has been added to the HTML, its now an error with the display.

    I’ll need you to open a ticket.
    https://connekthq.com/support/

    Thread Starter amddtim

    (@amddtim)

    Ticket opened.

    This appears to be happening on my system because almFadeIn is trying to set opacity on an array of 1 element, rather than an element.

    That’s happening because almDomParser is returning an array.
    (Array.prototype.slice.call(data.body.childNodes) returns an array with one node in it.)

    And that’s happening because of this code:
    if (!alm.transition_container) { // No transition container
    alm.el = alm.html;
    reveal = (alm.container_type === ‘table’) ? almTableWrap(alm.html) : almDomParser(alm.html, ‘text/html’);

    almTableWrap appears to deliberately return an array, so I assume reveal is meant to contain an array… Except everywhere else in that code, reveal is treated as a single element (not an array).

    Very strange.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Error: Cannot set property ‘opacity’ of undefined’ is closed to new replies.