Spectrometers are widely used tools in chemical and biological sensing, material analysis, and light source characterization. However, an important characteristic of traditional spectrometers for biomedical applications is stable operation. It can be achieved due to high fabrication control during the development and stabilization of temperature and polarization of optical radiation during measurements. Temperature and polarization stabilization can be achieved through on-chip technology, and in turn robustness against fabrication imperfections through sensor design. Here, for the first time, we introduce a robust sensor based on a combination of nanophotonic random spectrometer and microfluidics (NRSM) for determining ultra-low concentrations of analyte in a solution. In order to study the sensor, we measure and analyze the spectra of different isopropanol solutions of known refractive indexes. Simple correlation analysis shows that the measured spectra shift with a tiny variation of the ambient liquid optical properties reaches a sensitivity of approximately 61.8 ± 2.3 nm/RIU. Robustness against fabrication imperfections leads to great scalability on a chip and the ability to operate in a huge spectral range from VIS to mid-IR. NRSM optical sensors are very promising for fast and efficient functionalization in the field of selective capture fluorescence-free oncological disease for liquid/gas biopsy in on-chip theranostics applications.