outl1ne / nova-simple-repeatable

A Laravel Nova simple repeatable rows field.
MIT License
73 stars 42 forks source link

TypeError: Cannot read properties of undefined (reading 'find') #54

Closed KenHuangisGood closed 11 months ago

KenHuangisGood commented 11 months ago

This issue occurs when I use the update function. I add two lines and leave all the required fields empty in those two lines. Then, when I click submit, I get an error message saying that the necessary fields are not filled out. Finally, if I delete the second line, an error occurs.

version

error message

TypeError: Cannot read properties of undefined (reading 'find')
    at Proxy.getValidationKey (http://myserver/nova-api/scripts/simple-repeatable:2:34392)
    at http://myserver/nova-api/scripts/simple-repeatable:2:73351
    at Array.forEach (<anonymous>)
    at s (http://myserver/nova-api/scripts/simple-repeatable:2:73320)
    at Proxy.repeatableValidation (http://myserver/nova-api/scripts/simple-repeatable:2:73424)
    at Ee.run (http://myserver/vendor/nova/vendor.js?id=f249b9bf29d2374b7fa61636323b3851:2:1499936)
    at get value [as value] (http://myserver/vendor/nova/vendor.js?id=f249b9bf29d2374b7fa61636323b3851:2:1508813)
    at Object.get [as repeatableValidation] (http://myserver/vendor/nova/vendor.js?id=f249b9bf29d2374b7fa61636323b3851:2:1531633)
    at http://myserver/nova-api/scripts/simple-repeatable:2:76090
    at ni (http://myserver/vendor/nova/vendor.js?id=f249b9bf29d2374b7fa61636323b3851:2:1527877)
dmason30 commented 11 months ago

@Tarpsvo @marttinnotta Can confirm we are seeing this too seems to have been caused by the last release.

image
marttinnotta commented 11 months ago

Thank you for reporting this!

Currently I reverted my incompetent changes back to prior ForemData update (update that causes this). If you by any chance used json method I left it intact (it does nothing) so that it would not create any undefined errors.

In future I will add more thorough test cases with different fields to avoid this kind of situation.

I sincerely apologies for any inconvenience I may have caused.