The optical properties of transition-metal dichalcogenides have previously been modified at the nanoscale by using mechanical and electrical nanostructuring. However, a clear experimental picture relating the local electronic structure with emission properties in such structures has so far been lacking. Here, we use a combination of scanning tunneling microscopy (STM) and near-field photoluminescence (nano-PL) to probe the electronic and optical properties of single nanobubbles in bilayer heterostructures of WSe2 on MoSe2. We show from tunneling spectroscopy that there are electronic states deeply localized in the gap at the edge of such bubbles, which are independent of the presence of chemical defects in the layers. We also show a significant change in the local band gap on the bubble, with a continuous evolution to the edge of the bubble over a length scale of ∼20 nm. Nano-PL measurements observe a continuous redshift of the interlayer exciton on entering the bubble, in agreement with the band-to-band transitions measured by STM. We use self-consistent Schrödinger-Poisson simulations to capture the essence of the experimental results and find that strong doping in the bubble region is a key ingredient to achieving the observed localized states, together with mechanical strain.