Consider a narrow beam of EM waves that propagates in the Z direction and is concentrated near the YZ plane, so its intensity fades rapidly as we move away from the YZ plane in the X direction. Let the E field be in the X direction. Consider a cube with edges parallel to the X, Y and Z axes, respectively. Let the cube be placed at some distance from the YZ plane, and let its side length be much smaller than the wavelength. It seems that the flux of E through a wall closer to the YZ plane will be bigger than the flux of E through a parallel wall furter from the YZ plane, so it seems to violate the Gauss' law. Why doesn't it?