Hypothetical wall from inside to out:
1/2" drywall
vapor barrier
insulation/stud
7/16" OSB sheathing
1.5" Foam board insulating sheathing
Tyvek

So, if I install a new construction vinyl window, it gets secured to the foam board!? If I secure it to the OSB, the integral J channel in the window would get buried by the foam board.

Seems not very secure to me. Also makes for larger jamb extensions.

Obviously foam sheathing and vinyl windows go together all the time in new construction, so how is it done? Anyone know?