I understand that after passing through a narrow slit a photon's momentum is uncertain, however since its position can be inferred from having passed through the slit, a subsequent position measurement fully constrains the momentum direction. Therefore as long as we know the photon's wavelength, we have simultaneously measured x and p to arbitrary accuracy.
I forsee two possible responses:
1) Even though we may start with a photon of known $\lambda$, passing through the slit makes $\lambda$ uncertain. However I've never seen this discussed; always diffraction is described as changing momentum direction, not magnitude.
2) The HUP says that a position measurement makes subsequent momentum measurements uncertain, NOT that position and momentum cannot be simultaneously determined. However this is in strong tension with every description of the HUP I've ever seen, including an answer to a previous similar question here. Note that the previous link might be considered a duplicate of this question, however, I think both that question and answer are not focused enough to be informative.