Support

Account

Home Forums Add-ons Repeater Field Uncaught ReferenceError: wp is not defined

Solving

Uncaught ReferenceError: wp is not defined

  • Hey guys,

    We’re running WP 3.6 and ACF 4.2.2 and ACF Repeater 1.0.1.

    We get the error “Uncaught ReferenceError: wp is not defined” on the backend when loading a nested repeater.

    I have a nested repeater (attached xml export) that appears to be causing this error. Pages that have a single repeater load fine. This page loads until the 1st nested repeater should display, then throws the error. I’m not exactly sure when the error popped up, but it’s been since we upgraded to 3.6/4.2.2/1.0.1.

    Any help is greatly appreciated.

    Thanks,
    Jacob

  • Hi @jacobdubail

    Unfortunately, the file did not upload correctly, Can you please edit your topic and check it?

    Also, is this a JS error or PHP error? when does the error appear? after which event?

  • Hi elliot,

    This is a JS error. Here’s a quick screencast showing the error and the custom field details: http://quick.as/mqnibpm

    As you can see, the error pops up as the fields are loading.

    Any ideas?

    Thanks,
    Jacob

  • Here’s the xml file…

    looks like I can’t upload an xml file. sorry.

    -Jacob

  • Hi elliot,

    I forgot to mention that our homepage is non-functional until we get this issue resolved.

    I’ve added a new single-depth repeater to this group (above the troublesome repeater field) and it works. I re-created the troublesome multi-depth repeater field and it doesn’t work. It throws the same error as before.

    Edit: I’ve narrowed the problem down further. The problem only occurs when I add a “post object” field into the 2nd-level repeater field. If I change the post object field to a text field, everything works. Weird…

    Thanks,
    Jacob

  • Hi @jacobdubail

    Sounds like your page is timing out!
    The post object field is pretty basic and will load in a lot of data when repeated many times…

    Perhaps this is the issue

  • Elliot,

    The post object field is pretty basic and will load in a lot of data when repeated many times…

    No, this is not the issue.

    this is the issue:

    I’ve narrowed the problem down further. The problem only occurs when I add a “post object” field into the 2nd-level repeater field. If I change the post object field to a text field, everything works. Weird…

    +1 to solve this issue…

  • We can verify that this is the issue!

    This happens when a repeater field includes a post object field.

    (We also see that in the case where repeater has a post object the memory load on the server goes to the sky, and in some cases it breaks the limit:

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /var/www/alwaysfootball.dk/public_html/wp-includes/meta.php on line 578

    This could be related – but not verified)

  • Hi @jacobdubail

    It sounds like the post object field as a sub field is causing to many DB calls and producing a PHP error which then triggers the snowball that then causes the JS wp defined issue.

    Could this be possible?

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Uncaught ReferenceError: wp is not defined’ is closed to new replies.