Title: Solved Javascript error
Last modified: December 14, 2017

---

# Solved Javascript error

 *  [cramaekers](https://wordpress.org/support/users/cramaekers/)
 * (@cramaekers)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/solved-javascript-error/)
 * Being that this plugin is no longer supported, I figured I’d post my solution
   for a Javascript error that this plugin was throwing. My error was:
 * Uncaught TypeError: Cannot read property ’64’ of undefined in gf-repeater.min.
   js.
 * I fixed this error by changing lines 286-288 in class-gf-field-repeater.php to:
 *     ```
       if (empty($value)) {
           $value = array();
           $value['formId'] = $form_id;
       ```
   
 * The addition of `$value = array();` is the fix.
 * Hope this helps someone!
    -  This topic was modified 8 years, 5 months ago by [cramaekers](https://wordpress.org/support/users/cramaekers/).
    -  This topic was modified 8 years, 5 months ago by [cramaekers](https://wordpress.org/support/users/cramaekers/).

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

 *  [jimmysurprenant](https://wordpress.org/support/users/jimmysurprenant/)
 * (@jimmysurprenant)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9905874)
 * Hi,
 * I also have this error and this did not fix the error.
 * I am confused because this works well when I click preview form, but when I put
   the shortcode in a text editor, the form show up, the button as well, but the
   repeater is not working!
 *     ```
       Uncaught TypeError: Cannot read property '1' of undefined
           at gfRepeater_repeatRepeater (gf-repeater.min.js?ver=1.0.9:1)
           at HTMLSpanElement.<anonymous> (main.js:69)
           at HTMLSpanElement.dispatch (jquery-1.8.3.min.js:2)
           at HTMLSpanElement.u (jquery-1.8.3.min.js:2)
       ```
   
 * Now, I added this :
 *     ```
       if (empty($value)) {
           $value = array();
           $value['formId'] = $form_id;
       ```
   
 * But the error is still the same.
 * The Begin repeater has Repeater : ID field 1
    The end repeater has Repeater :
   ID field 3
 * Now, in the console, I’ve tried to look what is in gfRepeater_repeaters and this
   is what showed up :
 *     ```
       console.log(gfRepeater_repeaters)
       VM3008:1 {}__proto__: Objectconstructor: ƒ Object()arguments: (...)assign: ƒ assign()caller: (...)create: ƒ create()defineProperties: ƒ defineProperties()defineProperty: ƒ defineProperty()entries: ƒ entries()freeze: ƒ freeze()getOwnPropertyDescriptor: ƒ getOwnPropertyDescriptor()getOwnPropertyDescriptors: ƒ getOwnPropertyDescriptors()getOwnPropertyNames: ƒ getOwnPropertyNames()getOwnPropertySymbols: ƒ getOwnPropertySymbols()getPrototypeOf: ƒ getPrototypeOf()is: ƒ is()isExtensible: ƒ isExtensible()isFrozen: ƒ isFrozen()isSealed: ƒ isSealed()keys: ƒ keys()length: 1name: "Object"preventExtensions: ƒ preventExtensions()prototype: {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …}seal: ƒ seal()setPrototypeOf: ƒ setPrototypeOf()values: ƒ values()arguments: (...)caller: (...)length: 1name: "values"__proto__: ƒ ()<a href="https://codex.wordpress.org/Scopes">Scopes</a>: Scopes[0]No properties__proto__: ƒ ()<a href="https://codex.wordpress.org/Scopes">Scopes</a>: Scopes[0]hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()arguments: (...)caller: (...)length: 0name: "toString"__proto__: ƒ ()<a href="https://codex.wordpress.org/Scopes">Scopes</a>: Scopes[0]valueOf: ƒ valueOf()__defineGetter__: ƒ __defineGetter__()__defineSetter__: ƒ __defineSetter__()__lookupGetter__: ƒ __lookupGetter__()__lookupSetter__: ƒ __lookupSetter__()get __proto__: ƒ __proto__()set __proto__: ƒ __proto__()
       ```
   
 * So this returns an Object, but in gf-repeater.min.js, I see this :
    `gfRepeater_repeaters[
   e][r]` Where e represents the first parameter passed to gfRepeater_repeatRepeater()
   and r represents the second one. So my guess is that this is an Object ( gfRepeater_repeater)
   and when we try to access gfRepeater_repeaters[e][r], it returns undefined.
 * Knowing that, I still have no clue on how to work around this!
 * If you have any idea on this please reply.
    -  This reply was modified 8 years, 3 months ago by [jimmysurprenant](https://wordpress.org/support/users/jimmysurprenant/).
 *  Thread Starter [cramaekers](https://wordpress.org/support/users/cramaekers/)
 * (@cramaekers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9906073)
 * I ended up just installing the latest version from the [project’s GitHub page](https://github.com/kodie/gravityforms-repeater)
   and all is well on my end. Give that a shot!
 *  [jimmysurprenant](https://wordpress.org/support/users/jimmysurprenant/)
 * (@jimmysurprenant)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9906143)
 * The development link return 404 error :
    [https://codeload.github.com/kodie/gravityforms-repeater/zip/development](https://codeload.github.com/kodie/gravityforms-repeater/zip/development)
 * Do you still have the zip file and would it be possible for you to email it to
   me?
 *  Thread Starter [cramaekers](https://wordpress.org/support/users/cramaekers/)
 * (@cramaekers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9906148)
 * Try this: [https://github.com/kodie/gravityforms-repeater/archive/master.zip](https://github.com/kodie/gravityforms-repeater/archive/master.zip)
 *  [jimmysurprenant](https://wordpress.org/support/users/jimmysurprenant/)
 * (@jimmysurprenant)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9906269)
 * There is no javascript error anymore, the buttons does nothing. I’ve inspected
   element and see that there are no onClick action on the buttons.
 * It does work on preview mode on the form, but still not working when I put this
   on the website!
 * That is a strange behaviour!
 *  Thread Starter [cramaekers](https://wordpress.org/support/users/cramaekers/)
 * (@cramaekers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9906284)
 * If the preview works I would assume this is an error within your theme. What 
   theme are you using? Have you tried reverting back to a default theme, like Twenty
   Seventeen?
 *  [jimmysurprenant](https://wordpress.org/support/users/jimmysurprenant/)
 * (@jimmysurprenant)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9906314)
 * This is a custom theme, all the default themes have been deleted (I don’t know
   why, I have not developed this theme myself) Also, I have FTP access and cPanel,
   I do not have access to staging environment so it is complicated to try changing
   theme as it will affect the display.
 * If you don’t mind, I could maybe create an editor account for you so you can 
   take a look to see what really happen?
 *  Thread Starter [cramaekers](https://wordpress.org/support/users/cramaekers/)
 * (@cramaekers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9906324)
 * Sorry, I don’t have time currently to delve into a custom theme. I’d recommend
   creating a staging site so you can test, or put up a temporary “Down For Maintenance”
   message for 1 minute while you swap themes and check. That’s the only way to 
   know for sure where you problem is.
 *  [jimmysurprenant](https://wordpress.org/support/users/jimmysurprenant/)
 * (@jimmysurprenant)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9906358)
 * Ok no problem, thank you very much for the hints, I will try that out and come
   up with the results!
 *  Thread Starter [cramaekers](https://wordpress.org/support/users/cramaekers/)
 * (@cramaekers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9906362)
 * Happy to try and help. Good luck!
 *  [devinswett](https://wordpress.org/support/users/devinswett/)
 * (@devinswett)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9967224)
 * For me, the javascript error appeared to be coming from an incorrect element 
   getting confused for a repeater child element. Then when the JS tries to parse
   it, it’s completely unexpected, and ruins our day.
 * For me the fix came around line 222, just beneath the list of the variable declarations,
   just add a simple check to make sure ‘childInfo’ is defined.
 * if (childInfo === undefined) {
    return false; }

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

The topic ‘Solved Javascript error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/repeater-add-on-for-gravity-forms_f9f9f9.
   svg)
 * [Gravity Forms Repeater Add-On](https://wordpress.org/plugins/repeater-add-on-for-gravity-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/repeater-add-on-for-gravity-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/repeater-add-on-for-gravity-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/repeater-add-on-for-gravity-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/repeater-add-on-for-gravity-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/repeater-add-on-for-gravity-forms/reviews/)

 * 11 replies
 * 3 participants
 * Last reply from: [devinswett](https://wordpress.org/support/users/devinswett/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/solved-javascript-error/#post-9967224)
 * Status: not a support question