# Longitudinal component of fields in plane electromagnetic waves

Question: Why are the electric and magnetic field components of guided EM waves independent of the direction of propagation?

Details: I'll go on to paraphrase Griffiths' section on guided waves here-

For a waveguide that is a perfect conductor, the boundary conditions at the inner wall are $$E^{||}=0$$ and $$B^\perp=0$$

For monochromatic waves that propagate down such a waveguide along the $$z$$ direction-

$$\boldsymbol{\tilde{E}}(x,y,z,t) = \boldsymbol{\tilde{E_0}}(x,y)e^{i(kz-\omega t)}$$

$$\boldsymbol{\tilde{B}}(x,y,z,t) = \boldsymbol{\tilde{B_0}}(x,y)e^{i(kz-\omega t)}$$

Now, the book says that confined waves are not (in general) transverse; in order to fit the boundary conditions, we shall have to include longitudinal components $$E_z$$ and $$B_z$$:

$$\boldsymbol{\tilde{E_0}} = E_x\boldsymbol{\hat{x}} + E_y\boldsymbol{\hat{y}} + E_z\boldsymbol{\hat{z}}$$

and

$$\boldsymbol{\tilde{B_0}} = B_x\boldsymbol{\hat{x}} + B_y\boldsymbol{\hat{y}} + B_z\boldsymbol{\hat{z}}$$

$$\textbf{where each of the components is a function of x and y}$$.

I don't understand why each of the components has to be a function of $$x$$ and $$y$$ but not $$z$$.