The relationship here is one that comes out in geometric calculus. There, we consider the 2d plane as having 3 kinds of objects: scalars, vectors, and bivectors, which serve the role of the imaginary of complex analysis.
Here's how this works: we have a product of vectors such that $e_x e_y = -e_y e_x$, like the cross product, but $e_x e_x = e_y e_y = 1$, like the dot product. This "geometric product" produces a bivector, which represents an oriented plane, just as vectors represent oriented lines or directions.
Call $i = e_x e_y$, and let $f = u + iv$, in analogy to complex analysis. The condition $\nabla f= 0$ reproduces the Cauchy-Riemann condition. Explicitly, this is
$$\begin{align*} \nabla f &= (e_x \partial_x + e_y \partial_y )f \\ &= e_x \partial_x u + e_x e_x e_y \partial_x v + e_y \partial_y u + e_y e_x e_y \partial_y v \\ &= e_x \partial_x u + e_y \partial_x v + e_y \partial_y u - e_x \partial_y v \\ &= e_x (\partial_x u - \partial_y v) + e_y (\partial_y u + \partial_x v)\end{align*}$$
This is a well-known result: that $\nabla$ corresponds more to $\partial/\partial \bar z$ than it does with $\partial/\partial z$. What's interesting is that the integrability condition of $\nabla f = 0$ applies in higher dimensions also, even when the notion of complex differentiation is no longer clear.
To find the relationship between $f$ and a vector field $F$, multiply by $e_x$ on the right so $F = f e_x = u e_x - v e_y = U e_x + V e_y$, with $V = -v$. This generates the integrability condition
$$\nabla F = (\partial_x U + \partial_y V) + i (\partial_x V - \partial_y U)$$
The scalar part is the divergence and the bivector part is the curl. Both of these must be zero to satisfy the same integrability condition as the Cauchy-Riemann condition.
Edit: you might find that the vector field has a negative $y$-component compared to the complex function, but this is also a known result when converting between, say, velocity fields in 2d and complex functions. Geometric calculus only helps prove it mathematically.
Best Answer
Suppose $f = u + iv$.
In this case $u = Re f$ is holomorphic, but it is real valued, so $\frac{\partial u}{\partial y} = \frac{\partial u}{\partial x} = 0$, i.e. it is a constant function.
Cauchy-Riemann equation have the following form $\frac{\partial f}{\partial \bar z} = 0$, so then if $f(\bar z)$ is holomorphic, then $\frac{\partial f}{\partial z} = 0$ as well, which means that $f$ is a constant function.
Cauchy-Riemann equation tells you that $u_x = v_y, u_y = -v_x$. $|f|^2 = u^2 + v^2$ is a constant tells you that $uu_x + vv_x = uu_y + vv_y = 0$, combining them, you have a system of equations $uu_x - vu_y = 0, uu_y + vu_x = 0$, which has determinant $u^2 + v^2$. If $|f| = 0$, then $f = 0$ a constant. If $f \neq 0$, then the system of equations have a unique trivial solution, so again $f$ is a constant.