In ecology, species can mitigate their extinction risks in uncertain environments by diversifying individual phenotypes. This observation is quantified by the theory of bet-hedging, which provides a reason for the degree of phenotypic diversity observed even in clonal populations. Bet-hedging in well-mixed populations is rather well understood. However, many species underwent range expansions during their evolutionary history, and the importance of phenotypic diversity in such scenarios still needs to be understood. In this paper, we develop a theory of bet-hedging for populations colonizing new, unknown environments that fluctuate either in space or time. In this case, we find that bet-hedging is a more favorable strategy than in well-mixed populations. For slow rates of variation, temporal and spatial fluctuations lead to different outcomes. In spatially fluctuating environments, bet-hedging is favored compared to temporally fluctuating environments. In the limit of frequent environmental variation, no opportunity for bet-hedging exists, regardless of the nature of the environmental fluctuations. For the same model, bet-hedging is never an advantageous strategy in the well-mixed case, supporting the view that range expansions strongly promote diversification. These conclusions are robust against stochasticity induced by finite population sizes. Our findings shed light on the importance of phenotypic heterogeneity in range expansions, paving the way to novel approaches to understand how biodiversity emerges and is maintained.