It is well known that the Chern-Simons (CS) theory by itself is not gauge invariant in the presence of a spacetime boundary. Concretely, suppose the flat half space $\mathcal{M}$ with $x\in \mathbb{R}, y\in \mathbb{R_+}$ is filled with CS theory. Then under a gauge transformation $A_\mu \to A_\mu +\partial_\mu \phi$ the CS term with level 1 transforms as $$ S_{CS}[A]=\frac{1}{4\pi}\int_\mathcal{M} A\wedge dA \to \frac{1}{4\pi}\int _\mathcal{M}A\wedge dA+ \frac{1}{4\pi}\int_\mathcal{M} d\phi\wedge dA \\= S_{CS}[A]+\frac{1}{4\pi}\int_{\partial\mathcal{M}} \phi dA. $$ Therefore the partition function varies by $$ Z_{CS} \to Z_{CS}\exp\left[-\frac{i}{4\pi}\int \phi dA\right]. $$
It is also well understood (I believe) that this gauge non-invariance is precisely canceled by the chiral anomaly inflicting the chiral fermion living on $\partial \mathcal{M} = \{y=0\}$. Using the Fujikawa method, the boundary partition function ${Z}_{edge} = \int \mathcal{D\psi}\mathcal{D}\psi^\dagger\exp\left[-\int dx d\tau\, \psi^\dagger (-\partial_\tau +i \partial_x )\psi\right] $ is also non-gauge invariant, transforming as $$ {Z}_{edge} \to {Z}_{edge} \exp\left[\frac{i}{2\pi}\int \phi dA\right] $$ However, notice that there is a factor of 2 difference for the anomaly to cancel. I have checked carefully this is not just a naive sloppiness in keep track of prefactors.
I am aware a factor of 2 issue also occurs in the quantization of the level of the CS theory on a compact manifold. However it seems that in the literature the additional steps leading to this factor of 2 are justified by the topologically nontrivial gauge field configurations, while here one does not specify what the gauge field configuration is.
I'm sure I made a mistake somewhere as this physics can be shown with other methods. For example, Laughlin's argument clearly ensures the charge conservation for the bulk+edge theory. Also one can get the "correct" result if one just sticks with the familiar $$S_{CS}\to S_{CS} + \int (\delta S_{CS}/\delta A_\mu) \partial_\mu\phi$$ as in Noether's theorem for the bulk. But I don't see what is wrong with my derivation above.
Are there anyone familiar with this issue that can help me out on this?