Yes, the textbook is wrong. With one lone pair from the oxygen capable of conjugation (the other lone pair is a sigma pair in the plane of the ring) plus the three carbon-carbon bonds, we have eight pi electrons.
Possibly the confusion arises because eight pi electrons "should" make this molecule antiaromatic, thus highly unstable which does not match with experiment. But the 4n+2/4n rule applies only when the conjugated electrons are in a single cycle and most strictly with all conjugated atoms identical. The methylene-pyran molecule shown, with its pendant pi bond, does not meet either criterion.
Protonating the CH2 group in 2-methylene-2H-pyran leaves six pi electrons in a single cycle and thus a (pyrylium) cation with some aromatic character, so we may expect the molecule to be basic. Evidence for the existence and, indirectly, the basicity of this molecule may be seen in Zvezdina et al., where the protonated molecule as a perchlorate salt is reacted with a sufficiently strong base to generate 2-methylene-2H-pyran.
Zvezdina, É.A., Zhdanova, M.P., Bren, V.A. et al. "Reaction of methyl-substituted pyrylium salts with tertiary amines." Chem Heterocycl Compd 12, 1222–1226 (1976). https://doi.org/10.1007/BF00470218