Start a new topic

Need help urgently for the following: "TypeError: Cannot read property '0' of undefined"

We're having an issue with an application what we have created, which uses Kinvey to process everything. We have a dashboard with an Admin account. The admin needs to be able to log into the accounts of users who have signed up. But every time the login button is clicked (e.g. the login button next to the user within the admin account), we get a (400) bad request error followed by this debug message:



debug: "TypeError: Cannot read property '0' of undefined"

description: "The Business Logic script has a runtime error. See debug message for details."

error: "BLRuntimeError"



I have created a whole video walking through and explaining it:

https://www.dropbox.com/s/9kyx5oiun3jh7gl/Login%20To%20User%20Accounts%20As%20An%20Admin.mp4



Our account is hi@breakthroughapps.com if you want to login and check it out. We can supply more details if need be..



We're just really stuck on this one and need some clear guidance to how we fix it.



Thank you very much


Hi, you would get that error when trying to access an element of an array when that array does not actually exist (so that the variable/property containing the array is "undefined"). You should look through your BL code and make sure that you are always checking whether an array exists before trying to access its elements.



As a starting point, I'd recommend looking at your admin console code and following the code path that starts by clicking the login button, checking the relevant BL as you go.
Thanks a lot @Gal‌ we have sorted this issue out now!!! :smile:
Login or Signup to post a comment