Icy grain mantles are the main reservoir of the volatile elements that link chemical processes in dark, interstellar clouds with the formation of planets and the composition of their atmospheres. The initial ice composition is set in the cold, dense parts of molecular clouds, before the onset of star formation. With the exquisite sensitivity of the James Webb Space Telescope, this critical stage of ice evolution is now accessible for detailed study. Here we show initial results of the Early Release Science programme Ice Age that reveal the rich composition of these dense cloud ices. Weak ices, including 13CO2, OCN−, 13CO, OCS and complex organic molecule functional groups, are now detected along two pre-stellar lines of sight. The 12CO2 ice profile indicates modest growth of the icy grains. Column densities of the major and minor ice species indicate that ices contribute between 2% and 19% of the bulk budgets of the key C, O, N and S elements. Our results suggest that the formation of simple and complex molecules could begin early in a water-ice-rich environment.