The current density is not defined as $\mathrm di/\mathrm dS$. The precise definition of current density is the following
$$\mathbf j=\left(\lim _{\Delta S\to 0} \frac{i}{\Delta S}\right) \mathbf{\hat n}$$
where $\mathbf{\hat n}$ is the unit vector in the direction perpendicular to the infinitesimal area ($\Delta S$), and
$$i=\frac{\mathrm d q}{\mathrm dt}$$
where $q$ is the charge passing through/crossing the area $\Delta S$. Note that for any real physical scenario, as $\Delta S$ goes to $0$, so does the current ($i$) passing through it. Thus, when $\Delta S$ is infinitesimal, so is the current, but writing it as $\mathrm di$ is abuse of notation, because $\mathrm d(\rm quantity)$ is primarily used when we are taking an infinitesimal change in the "$\rm quantity$" (not the case here), or taking an infinitesimal element of that "$\rm quantity$" (also, not exactly the case here).
In this light, the definition given in your book is, strictly speaking, incorrect. However, it is highly likely that the author meant to convey the above definition, but abused the notation, thus rendering the definition incorrect.