I'm reading a section in a textbook about the Aharonov-Bohm effect, which claims that the eigenfunction (outside the solenoid, so $\operatorname{curl} A=0$) for the canonical momentum operator $$\pi = \frac{\hbar}{i}\nabla - \frac{q}{c}A$$ is $$\Psi = \exp(i k_0\cdot x) \exp\left(\frac{iq}{\hbar c}\int_{x_0}^x A\cdot dx\right).$$
I don't understand why this holds. Doesn't this imply that $A$ can be expressed as the gradient of a potential: $$ A = \nabla \int_{x_0}^x A\cdot dx$$ On the other hand $A$ is clearly not a conservative vector field, since $$\int_C A = \Phi_\text{mag} \neq 0,$$ for any closed $C$ around the solenoid. This is then in contradiction to the former statement as gradient fields are always conservative. Whats going wrong here?