The poem appeares as No. 658 in the Kokin Wakashu, an old anthology of poems from the 12th century. Komachi was a classic even at that time: she lived in the 9th century.
kayoedomo
utsutsu ni hitome
mishigoto wa arazu
A line-by-line translation:
in [my] dreams / along dream paths
without resting my legs
[I] go often [to you]
in the real world, a single glimpse
is different.