Home Forums ACF PRO Uncaught TypeError: Cannot read property 'length' of undefined


Uncaught TypeError: Cannot read property 'length' of undefined

  • Hello,

    I have a repeater field in an options page and I am unable to save more than 199 rows of data when I try to add the 200th row the console shows “Uncaught TypeError: Cannot read property ‘length’ of undefined” error thrown by

  • Follow up with error screenshot

  • I’ve just got this with the latest 5.2.4 as well 🙁

  • Yeah likewise got this too, throwing an error so can’t update any fields/field groups.

  • I have a hunch that the issue reported by @bhargavy is due to a different problem. This error though is being generated in the current 5.2.4 release of ACF Pro and as soon as I reverted back to 5.2.3 it went away. So for me at least I have found a temp solution to the problem.

    I have reported the issue to Elliot about this occurring in 5.2.4 and am waiting feedback.

  • Hi guys

    Thanks for the bug report.

    I think the issue is due to validating such a large amount of fields.
    I believe that there is a server limit which is causing AJAX result to not return JSON, but instead return a fail ‘0’.

    I’ll do some testing and have this fixed soon.

  • Hi guys

    an you please specify when this JS error occurs?
    Is it when saving a post, or the field group? Or both?

  • Hey guys.

    Update – I’ve found and fixed the issue and will release a new version later today.


  • Hey guys

    I’ve just released a new version 5.2.5 to address this issue.

    Thanks again for the bug report. Please post back after updating and let me know if the problem is solved.

    Please also notify any other threads you find of a similar issue, and link them here. That would be great!


  • Had the same issue yesterday. Did a rollback to 5.2.3 and updated now to 5.2.5. Seems to be working fine again. Thanks for your quick response and bugfix.

  • Yep I can confirm it is fixed as well now. Cheers @elliot

  • Hey all…

    I updated from 5.2.3 to 5.2.5 and had trouble saving a basic ‘page’ with a few custom fields, nothing with much data. I rolled back to 5.2.3 and all is well again.

    Had the same JS error reported in the title (preventing the save).

    Just chiming in here that I’m not 100% that this snag has been remedied. Please let me know if I can help any!


  • Hi @rpetersnmt

    Thanks for the feedback.

    Any chance I can get a login to test on your site?


  • Can confirm this is still happening on 5.2.5 on several sites for me.

  • Hi @davemac

    Thanks for the feedback, can you please provide a login for me to test?


  • This reply has been marked as private.
  • Hi @davemac

    Thanks for the details, however this site is using ACF PRO 5.2.4, please update to 5.2.5 and also provide the exact edit page where the issue exists

  • This reply has been marked as private.
  • Hi @davemac

    Thanks for the update.

    I can see the error and believe I know where it is coming from. Are you able to provide the user with permissions to edit plugins so I can perform some console log within the ACF PRO JS?

  • Thanks Elliot.

    You should be able to edit files and plugins now.

  • This reply has been marked as private.
  • Hi @davemac

    Thanks for the update. I’ve just logged in, updated ACF PRO to 5.2.5 and the page saves fine without any JS length error to be seen…

    Perhaps the issue is due to another script which has since changed or perhaps a JS cache issue?

    Let me know, and please do a hard refresh before testing to clear your browsers cache


  • Still getting this issue with 5.2.5 on multiple sites, including the site discussed privately above – it seems to be sites with quite a large amount of ACF fields.

    Have tried clearing cache but the issue still persists. Downgrading to 5.2.4 fixes the issue for me.

  • Hi @davemac

    This is very strange. I was able to save the data just fine…

    I’ve just released a new version today, perhaps attempt to update and test it out. Let me know what you find. For us to have 2 different results from the same user / website is very strange indeed

  • i’m getting this error , have been since 5.2.5 , cannot update or publish posts or pages , just updated to 5.2.6 … same, same .. not fixed

    Uncaught TypeError: Cannot read property 'length' of undefinedm.extend.each @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:2(anonymous function) 
    @ acf-input.min.js:2r 
    @ acf-input.min.js:1n 
    @ acf-input.min.js:1acf.apply_filters @ acf-input.min.js:1acf.validation.acf.model.extend.fetch_success 
    @ acf-input.min.js:2acf.validation.acf.model.extend.fetch.$.ajax.success 
    @ acf-input.min.js:2m.Callbacks.j 
    @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:2m.Callbacks.k.fireWith 
    @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:2x 
    @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:4m.ajaxTransport.send.b 
    @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,farbtastic,quicktags,jquery-ui-core,jq…:4
Viewing 25 posts - 1 through 25 (of 34 total)

The topic ‘Uncaught TypeError: Cannot read property 'length' of undefined’ is closed to new replies.