The accuracy of a small compass mounted on the stem would be questionable regardless of any magnetic effect from frame or mounting material. I agree with other posters- use a decent lensatic or baseplate compass tucked into your jersey when you stop to get your bearing. Ans stand far enough away from the bike to ensure no effect.
Or, get a Garmin with a compass feature.