  Polarization of the cosmic microwave background (CMB) is sensitive to new
physics violating parity symmetry, such as the presence of a pseudoscalar
"axionlike" field. Such a field may be responsible for early dark energy (EDE),
which is active prior to recombination and provides a solution to the so-called
Hubble tension. The EDE field coupled to photons in a parity-violating manner
would rotate the plane of linear polarization of the CMB and produce a
cross-correlation power spectrum of $E$- and $B$-mode polarization fields with
opposite parities. In this paper, we fit the $EB$ power spectrum predicted by
the photon-axion coupling of the EDE model with a potential $V(\phi)\propto
[1-\cos(\phi/f)]^3$ to polarization data from Planck. We find that the unique
shape of the predicted $EB$ power spectrum is not favored by the data and
obtain a first constraint on the photon-axion coupling constant, $g=(0.04\pm
0.16)M_{\text{Pl}}^{-1}$ (68% CL), for the EDE model that best fits the CMB and
galaxy clustering data. This constraint is independent of the miscalibration of
polarization angles of the instrument or the polarized Galactic foreground
emission. Our limit on $g$ may have important implications for embedding EDE in
fundamental physics, such as string theory.
