[Vuejs]-Yup validation -> TypeError: Cannot read properties of undefined (reading 'forEach') at eval (changePassword.vue?18d1:231:1)

0👍

In the end. The problem wasn’t the code from the .vue file but rather, the exporting of the checkPassword function from another file.

I wrote the helper function as:

async function checkPassword(username, password){
 /*CODE*/
}

export default { checkPassword }

And what solved it was putting and export before the function itself, as follows:

export async function checkPassword(username, password){
 /*CODE*/
}

export default { checkPassword }

Leave a comment