Nabla operator is defined by

$$\nabla = \sum^3_{i=1} \frac{1}{h_i}\frac{\partial}{\partial q_i}\vec{e}_{q_i}$$
where ##q_i## are generalized coordinates (spherical polar, cylindrical...) and ##h_i## are Lame coefficients. Why then
$$div(\vec{A})=\sum^3_{i=1} \frac{1}{h_i}\frac{\partial}{\partial q_i}\vec{e}_{q_i} \cdot \sum_j A_j\vec{e}_{q_j}=\sum_i\frac{1}{h_i}\frac{\partial}{\partial q_i}A_i$$
where I am making the mistake?
here is different definition.
The unit vectors are generally functions of position; only in cartesian coordinates are they constants. This is why we generally write $\nabla = \sum_i \mathbf{e}_i h_i^{-1} \partial_i$ to make it clear that the derivative does not operate on $\mathbf{e}_i$ or $h_i$. However for divergence we get $$\sum_i \mathbf{e}_i h_i^{-1} \partial_i \cdot \left( \sum_j A_j \mathbf{e}_j \right) = \sum_i \sum_j \mathbf{e}_i h_i^{-1} \cdot \left( A_j \partial_i\mathbf{e}_j + \mathbf{e}_j \partial_i A_j \right)$$