$\vec{B}=\nabla \times \vec{A}\tag1$
This is true because at every point $\nabla\cdot\vec{B}=0 \tag2$
In free space points,
$\displaystyle \vec{B}=\dfrac{\mu_0}{4 \pi}\int_C \dfrac{I\ dl \times\hat{r}}{r^2}\tag3$
Consequently: $\nabla \cdot\vec{B}=0 \tag2$
At the points on the circuit, there is a singularity and we cannot directly apply equation $(3)$, i.e. Biot Savart law.
So in this case how can $\nabla \cdot\vec{B}=0 $
Edit (My understanding) @ garyp:
$\text{I am a graduate student. So I may seem to be a bit naive. Anyway please tell whether}\\ \text{I am understanding in the right way.}$
Here I am not considering the circuit as three dimensional.
By considering it as one dimensional, the (closed) circuit becomes equivalent to a magnetic dipole layer of infinitesimal thickness.
By using inverse square law of magnetic poles, we can find magnetic field (intensity) at any point outside the magnetic dipole layer (even at points infinitely close to the dipole layer). Let's first see the magnetic field due to an element of dipole layer at a point infinitely close to it:
$$\vec{B}=\mu_0\vec{H}= k \ M\ \left[ \dfrac{\hat{r_1}}{r_1^2}-\dfrac{\hat{r_2}}{r_2^2} \right] dS'$$
(where $M$ is magnetic pole density and $S'$ is the surface of magnetic dipole layer)
Now making use of divergence formula in spherical coordinates:
\begin{align} \nabla \cdot \vec{B} &= k \ M\ \left[ \nabla \cdot \dfrac{\hat{r_1}}{r_1^2}-\nabla \cdot \dfrac{\hat{r_2}}{r_2^2} \right]\ dS' \\ & = \lim_{r\to\ 0} k \ M\ \left \{ \left[ \dfrac{1}{r^2} \dfrac{\partial \left( r^2 \dfrac{\hat{r}}{r^2} \right)}{\partial r} \right]_{\text{at }r_1} -\left[ \dfrac{1}{r^2} \dfrac{\partial \left( r^2 \dfrac{\hat{r}}{r^2} \right)}{\partial r} \right]_{\text{at }r_2} \right \} dS' \\ \text{We see the two $r^2$ cancel out} \\ & = \lim_{r\to\ 0} k \ M\ \left[ \left[ \dfrac{1}{r^2} \dfrac{\partial \hat{r}}{\partial r} \right]_{\text{at } r_1} - \left[ \dfrac{1}{r^2} \dfrac{\partial \hat{r}}{\partial r} \right]_{\text{at } r_2} \right] dS'\\ & =0\\ \text{(This is because $\dfrac{\partial \hat{r}}{\partial r}=0$)} \end{align}
Therefore the divergence (at points outside the dipole layer) due to each of the elements of dipole layer is zero. That is, the divergence (at points outside the dipole layer) due to the magnetic dipole layer is zero.
Thus we see that the magnetic field may blow up at points infinitely close to the dipole layer but its divergence will still be zero.
Thus the divergence of magnetic field due to (closed) circuit is zero everywhere except at points on the (closed) circuit. Now comes the key point: Since we know the divergence of magnetic field due to a (closed) circuit, even at points infinitely close to the circuit, is zero we ignore the circuit and say $\nabla \cdot \vec{B}=0$ everywhere on $\mathbb R^3$.