The filamentation of electromagnetic waves in a free-electron laser with deeply trapped electrons is analysed. This instability is the result of particle bunching along transverse directions (with respect to the fast wave vector), as opposed to the untrapped-electron case, where it is a result of longitudinal bunching. Two cases are considered: (i) the non-resonant or reactive one, with purely imaginary growth rates; and (ii) the resonant one, with large (small) values of the real (imaginary) part of the perturbing frequency. In particular, we find that the reactive instability occurs only when the wiggler amplitude is unusually large. On the other hand, we show that the resonant process (with frequencies close to the synchrotron frequency) may be relevant for conventional free-electron lasers and that the growth rate for quasi-trans verse perturbations may be larger than that corresponding to longitudinal perturbations. Owing to the inhomogeneity and anisotropy of our system, low-frequency magnetic fields are generated. These fields, as well as the transverse electric fields, are analysed, and their role in the low-frequency dynamics is clarified.