Okay, great. Are you able to follow what this error is saying?
first argument contains undefined in property ‘posts.slug’
It means the post you are passing doesn’t have a slug. So you need to trace back to where that function is called and see why the post does not have a slug.
Let me know how that goes.