Weakly nonlinear packets of surface gravity waves over topography are governed by a nonlinear Schrödinger equation with variable coefficients. Using this equation and assuming that the horizontal scale of topography is much larger than the width of the packet, we show that, counter-intuitively, the amplitude of a shoaling packet decays, while its width grows. Such behaviour is a result of the fact that the coefficient of the nonlinear term in the topography-modified Schrödinger equation decreases with depth. Furthermore, there exists a critical depth, $h_{cr}$, where this coefficient changes sign – if the packet reaches $h_{cr}$, it disperses.