Viruses maximize their genetic coding capacity through a variety of biochemical mechanisms, including programmed ribosomal frameshifting (PRF), which facilitates the production of multiple proteins from a single mRNA transcript. PRF is typically stimulated by structural elements within the mRNA that generate mechanical tension between the transcript and ribosome. However, in this work, we show that the forces generated by the cotranslational folding of the nascent polypeptide chain can also enhance PRF. Using an array of biochemical, cellular, and computational techniques, we first demonstrate that the Sindbis virus structural polyprotein forms two competing topological isomers during its biosynthesis at the ribosome-translocon complex. We then show that the formation of one of these topological isomers is linked to PRF. Coarse-grained molecular dynamics simulations reveal that the translocon-mediated membrane integration of a transmembrane domain upstream from the ribosomal slip site generates a force on the nascent polypeptide chain that scales with observed frameshifting. Together, our results indicate that cotranslational folding of this viral protein generates a tension that stimulates PRF. To our knowledge, this constitutes the first example in which the conformational state of the nascent polypeptide chain has been linked to PRF. These findings raise the possibility that, in addition to RNA-mediated translational recoding, a variety of cotranslational folding or binding events may also stimulate PRF.