Biogenesis of nuclear pore complexes (NPCs) includes the formation of the permeability barrier composed of phenylalanine-glycine-rich nucleoporins (FG-Nups) that regulate the selective passage of biomolecules across the nuclear envelope. The FG-Nups are intrinsically disordered and prone to liquid–liquid phase separation and aggregation when isolated. How FG-Nups are protected from making inappropriate interactions during NPC biogenesis is not fully understood. Here we find that DNAJB6, a molecular chaperone of the heat shock protein network, forms foci in close proximity to NPCs. The number of these foci decreases upon removal of proteins involved in the early steps of interphase NPC biogenesis. Conversely, when this process is stalled in the last steps, the number of DNAJB6-containing foci increases and these foci are identified as herniations at the nuclear envelope. Immunoelectron tomography shows that DNAJB6 localizes inside the lumen of the herniations arising at NPC biogenesis intermediates. Loss of DNAJB6 results in the accumulation of cytosolic annulate lamellae, which are structures containing partly assembled NPCs, a feature associated with disturbances in NPC biogenesis. We find that DNAJB6 binds to FG-Nups and can prevent the aggregation of the FG region of several FG-Nups in cells and in vitro. Together, our data show that the molecular chaperone DNAJB6 provides quality control during NPC biogenesis and is involved in the surveillance of native intrinsically disordered FG-Nups.