According to some reliable sources, the residue theorem can be stated as: the sum of residues of a function on the whole complex plane(including infinity) is zero.
Now consider $$f(x) = \frac{\csc(\pi/x)}{x^2}$$ which has singularities at $+1, -1, 0, \infty$.
By Laurent expansion, I found that the residue is $\frac{1}{\pi}$ for $1, -1$ and $0$, and the residue at infinity is $\frac{-1}{\pi}$.
Obviously, this contradicts the residue theorem.
What mistakes did I make?