Let $x^2+y^2+z^2=R^2$ be the equation of the sphere we want to calculate the flux through, and $\vec{r}=x\hat i+y\hat j+z\hat k$ be the position vector field. We can compute it via divergence theorem: $$\Phi=\iiint_V(\nabla\cdot \vec r)dV=3\iiint_V dV=3\dfrac{4}{3}\pi R^3=4\pi R^3.$$
Or like this too: $$\Phi=\oint_S \vec r\cdot d\vec S=\oint_S R(\hat r\cdot\hat r)dS=R\oint_S dS=4\pi R^3.$$
But when I try to calculate it using the fact that $dS=||\partial_x \vec r\times \partial_y \vec r||dxdy$ ($\vec r(x,y)$ being the parametrized surface), I fail:
Let's parametrize the surface like $$\vec r(x,y)= \left(x,y,\pm\sqrt{R^2-x^2-y^2}\right).$$ Now we can calculate the cross product, $$\partial_x \vec r\times \partial_y \vec r=\left|\begin{array} \hat{i} & \hat j& \hat k\\ 1 & 0 & -\frac{x}{z}\\ 0 & 1 & -\frac{y}{z} \end{array}\right|=\dfrac{x}{z}\hat i+\dfrac{y}{z}\hat j+\hat k,$$ and thus we'll get the norm: $$\Longrightarrow ||\partial_x \vec r\times \partial_y \vec r||=\sqrt{1+\dfrac{x^2}{z^2}+\dfrac{y^2}{z^2}}=\sqrt{\dfrac{x^2+y^2+z^2}{z^2}}=\dfrac{R}{|z|}.$$
We can now apply these equations to the surface integral: $$\Longrightarrow \Phi=\oint_S R(\hat r\cdot \hat r)dS=R\oint_S \dfrac{R}{|z|}dxdy.$$
And changing into spherical coordinates we'd get that $$R^2\int_0^{2\pi}\int_0^\pi\dfrac{R^2\sin\theta}{R|\cos\theta|} d\theta d\Phi=2\pi R^3 I,$$ and $I$ does not converge...