Two-dimensional (2D) materials are composed of atomically thin crystals with an enormous surface-to-volume ratio, and their physical properties can be easily subjected to the change of the chemical environment. Encapsulation with other layered materials, such as hexagonal boron nitride, is a common practice; however, this approach often requires inextricable fabrication processes. Alternatively, it is intriguing to explore methods to control transport properties in the circumstance of no encapsulated layer. This is very challenging because of the ubiquitous presence of adsorbents, which can lead to charged-impurity scattering sites, charge traps, and recombination centers. Here, we show that the short-circuit photocurrent originated from the built-in electric field at the MoS2 junction is surprisingly insensitive to the gaseous environment over the range from a vacuum of 1X10^(-6) Torr to ambient condition. The environmental insensitivity of the short-circuit photocurrent is attributed to the characteristic of the diffusion current that is associated with the gradient of carrier density. Conversely, the photocurrent with bias exhibits typical persistent photoconductivity and greatly depends on the gaseous environment. The observation of environment-insensitive short-circuit photocurrent demonstrates an alternative method to design device structure for 2D-material-based optoelectronic applications.