Problems in Moralis.transfer()

Hey guys!
I want to get transaction confirmation after executing Moralis.transfer().
To do this, Moralis document says we would use transaction.wait()
I tried like this but .wait() function is not recognized in TypeScript. (Next.js + TypeScript)
It works fine in dev environment (npm run dev) but it has building error when deploying. (npm run build)
What should I do?