  We prove that harmonic maps into Euclidean buildings, which are not
necessarily locally finite, have singular sets of Hausdorff codimension 2,
extending the locally finite regularity result of Gromov and Schoen. As an
application, we prove superrigidity for algebraic groups over fields with
non-Archimedean valuation, thereby generalizing the rank 1 $p$-adic
superrigidity results of Gromov and Schoen and casting the Bader-Furman
generalization of Margulis' higher rank superrigidity result in a geometric
setting. We also prove an existence theorem for a pluriharmonic map from a
K\"ahler manifold to a Euclidean building.
