In Framer Motion, translateY is usually part of the style or motion.div/motion.img elements, not inside the animate keyframes.
Change translateY to y in your animate like this:
animate={{
y: [-30, 30]
}}
That should fix the build error.