A guesthouse is, to many of us, the ultimate dream-home wish list item: Instead of being jammed into a tiny bedroom, visitors get a whole house. That’s good for everyone—having a separate space can actually make your in-laws’ lengthy visits enjoyable (or at least tolerable). Plus, there’s the potential cash flow from renting it out.

But guesthouses (also known as “accessory dwelling units,” or ADUs) aren’t all money and in-law magic. Purchasing a property with an ADU can be a legal and financial nightmare if you’re not prepared.

“A guesthouse can be a great investment, but it can also be a foolish one if the homeowner does not understand all the pros and cons upfront,” says Ron Humes, a contractor and real estate agent.