We report the discovery of shocked molecular and ionized gas resulting from jet-driven feedback in the low-redshift (z = 0.0602) compact radio galaxy 4C 31.04 using near-IR imaging spectroscopy. 4C 31.04 is a ̃100 pc double-lobed Compact Steep Spectrum source believed to be a very young active galactic nucleus (AGN). It is hosted by a giant elliptical with a ̃ 10$^9$ M_☉ multiphase gaseous circumnuclear disc. We used high spatial resolution, adaptive optics-assisted H- and K-band integral field Gemini/NIFS observations to probe (1) the warm (̃10$^3$ K) molecular gas phase, traced by ro-vibrational transitions of H$_2$, and (2), the warm ionized medium, traced by the [Fe II]_\1.644 \ensuremathμ m\ line. The [Fe II] emission traces shocked gas ejected from the disc plane by a jet-blown bubble 300-400 pc in diameter, while the H$_2$ emission traces shock-excited molecular gas in the interior ̃ 1 kpc of the circumnuclear disc. Hydrodynamical modelling shows that the apparent discrepancy between the extent of the shocked gas and the radio emission can occur when the brightest regions of the synchrotron-emitting plasma are temporarily halted by dense clumps, while less bright plasma can percolate through the porous ISM and form an energy-driven bubble that expands freely out of the disc plane. Simulations suggest that this bubble is filled with low surface brightness plasma not visible in existing VLBI observations of 4C 31.04 due to insufficient sensitivity. Additional radial flows of jet plasma may percolate to ̃ kpc radii in the circumnuclear disc, driving shocks and accelerating clouds of gas, giving rise to the H$_2$ emission.