Definition of the order of a meromorphic function Let $X$ be a complex manifold and $Y \subset X$ a hypersurface.  Let $x \in Y$ and $f$ a meromorphic function on $X$ near $x$.  In Huybrecht's Complex Geometry the order of $f$ along $Y$ at $x$ is defined as
$$
f = g^{ord_{Y,x}(f)} \cdot h
$$
where $h \in \mathcal O_{X,x}^*$, the sheaf of germs of nonvanishing sections on $x$, and $g\in \mathcal O_{X,x}$ is irreducible and defines $Y$ near $x$.
I'm having trouble coming to grips with this definition.  Consider the case $X = \mathbb C^2$ with coordinates $(z_1,z_2)$ and $Y = \{z_1 = 0\}$.  Then what is $ord_{Y,(0,0)} z_2$?  It seems impossible to write $z_2 = z_1^d h$ for some $h \in \mathcal O_{X,x}^*$.  Further, it is stated that the order at any point on an irreducible hypersurface is independent of the point.  But clearly $ord_{Y,x} z_2 = 0$ if $x \ne (0,0)$.  So if the order is 0 at (0,0) as well, then this is saying that $z_2 \in \mathcal O_{X,(0,0)}^*$.  What am I missing?
Thanks.

Everything becomes crystal-clear once you recall: 
$$\large \mathcal O_{X,x}  \text {is a UFD} $$
Then if the germ of $Y$ at $x$ is defined by the irreducible element $g\in \mathcal O_{X,x}$, you can write-as in every UFD- any non-zero   $f\in  \mathcal M_x=Frac(O_{X,x})$    uniquely as:
 $$f=g^n\Pi h^{n_h}=g^n (stuff)    \quad (*)$$ where
- the $h$'s are pairwise non associated and run through the irreducibles of  $\mathcal O_{X,x}$ not associated to $g$,
- $n,n_h\in \mathbb Z$ are almost all zero (  "unicity" is up to order of factors and up to invertible elements, as usual in a UFD) .
The order of $f$ along $Y$ at $x$ is then, very naturally, the exponent $n$ of $g$ in $(*)$.
In your example $z_1$ and $z_2$ are two non-asociated irreducibles so that if $Y$is defined locally by $z_1=0$, you write $f=z_2=(z^1)^0.( stuff)$ and you get that the order of vanishing of $z_2$ along $Y$ is $0$
[of course $(\text stuff)=z_2$, but that's irrelevant!]
Edit QiL's crisp and definitive comment made me want to check Huybrechts's definition.
His Definition 2.3.5.on page 78 states:        
"Let $f$ be a meromorphic function in a neighbourhood of 
$x\in Y$. Then the order  $ord_{Y,x}(f)$ of $f$ in $x$ with respect to$Y$ is given by the equality $f=g^{\text {ord}(f)}.h$ with $h\in \mathcal O^*_{X,x}$." 
This is a completely wrong  definition since it is impossible to find such a factorization of $f$ in general: it would imply in particular that any germ at $x$ of a holomorphic function on $X$ would have a zero set coinciding with $Y$ at $x$, an obviously preposterous conclusion.
