AlCl3 (21.08 g, 158.1 mmol) was slowly added at -25 °C in a mixed solvent of 1,2-dichloroethane (100 mL) and nitromethane (100 mL) as methyl 1-methylpyrrole-2-carboxylate (10 g, 71.86 mmol) and 1,1-dichlorodimethyl ether (8.26 g, 71.86 mmol). The reaction mixture was stirred continuously at -25 °C for 0.5 hours. Upon completion of the reaction, the mixture was carefully poured into ice water (100 mL) to quench the reaction. Subsequently, the organic layer was separated by extraction with dichloromethane (100 mL) and water (100 mL). The organic layer was dried with anhydrous sodium sulfate, filtered and concentrated under reduced pressure. The crude product was purified by silica gel column chromatography (eluent: ethyl acetate/petroleum ether=1/1) to afford methyl 4-formyl-N-methylpyrrole-2-carboxylate (11.77 g, 70.42 mmol, 98% yield) as a yellow solid. Mass spectrum (EI+, m/z): 168.2 [M+H]+. NMR hydrogen spectrum (400 MHz, DMSO-d6) δ 9.71 (s, 1H), 7.91 (d, J=1.8 Hz, 1H), 7.22 (d, J=1.8 Hz, 1H), 3.92 (s, 3H), 3.78 (s, 3H).NOESY experiments further confirmed the structure of the target compound.