Consider the curve $$C:x+y+y^3+x^4=0\subset\mathbb{A}_k^2.$$ I want to calculate the principal divisor of $f:x+y\in k(C)$.
Since $f$ has no poles in $C$, we just look at point $(a,b)\in C$ with $a+b=0$. That is $(0,0)$ and $(1,-1)$.
We have $v_{(0,0)}(f)=1=v_{(1,-1)}(f)$. So the principal divisor is $$\operatorname{div} (f)=1\cdot(0,0)+1\cdot (1,-1).$$
Is this right so far?
Now consider the homogenization $\widetilde{C}$ of $C$, that is $$\widetilde{C}:x_0^3x_1+x_0^3x_2+x_0x_2^2+x_1^4=0\subset\mathbb{P}_k^2.$$ The points with $f(a:b:c)=b+c=0$ on $\widetilde{C}$ are $(1:0:0)$ and $(1:1:-1)$. So the divisor of $f$ on $\widetilde{C}$ is $$\operatorname{div} (f)=1\cdot(1:0:0)+1\cdot (1:1:-1).$$
Now my question:
I have learned that the degree of a principal divisor on a projective curve is equal to $0$. But here we have $\deg \operatorname{div}(f)=2\neq 0$. So where is the problem?