Combining sodium hydride with some solvents can be a bad idea, as a group of researchers from Corteva Agriscience and Dow Chemical remind the chemistry community in Organic Process Research & Development ,(2019, DOI: 10.1021/acs.oprd.9b00276).
Reports of explosions from combining NaH with a polar aprotic solvent such as dimethyl sulfoxide (DMSO), N,N-dimethylformamide (DMF), and N,N-dimethylacetamide (DMAc) go back at least to 1966:
Sodium hydride-DMSO mixture explodes
A violent pressure explosion occurred during the preparation of methylsulfinyl carbanion by a scheme involving the addition of sodium hydride to an excess of dimethyl sulfoxide. Scientists at the Cancer Chemotherapy Research Department of Mount Zion Hospital and Medical Center (Palo Alto, Calif.) were scaling up a seemingly effective method of C-methylating heteroaromatics [J. Org. Chem., 31, 248 (1966)]. When the CCR chemists tried a mole ratio DMSO (2.15) : sodium hydride (0.41) : isoquinoline (0.40), the methylation was incomplete. And it did not explode.
In the next experiment, 4.5 moles of sodium hydride were added, in five portions during three hours, to 18.4 moles of DMSO. The reaction was kept at 70 °C. and mechanically stirred. After an hour, solution was complete. Then, however, the temperature increased slightly and a greenish solid began to separate. The reaction was cooled, but the temperature rose sharply and after a few seconds the explosion occurred. A noxious gas filled the laboratory and a water-soluble, viscous, polymerlike material coated the hood and its contents.
Frederick A. French of the Cancer Chemotherapy laboratory says that he knows of no previous mishaps with solutions of alkaline reagents in DMSO. However, the hazards from acidogenic reagents, such as acid chlorides and halomethyl ketones, and DMSO are well known, he notes.C&EN April 11, 1966, page 48
From C&EN’s story about the new OPR&D paper:
Yang and coworkers also investigated the chemistry that makes these combinations unsafe. Yang says that radical reactions between the base and the solvents can generate gases, including dimethylsulfide and ethylene in the case of NaH added to DMSO. . . . [Yang] points out that there are alternatives that can perform the same chemistry, although there is no combination that can be universally applied as a substitute. Tetrahydrofuran could be used as a solvent with NaH, and there are alternative bases, like alkoxides and hydroxides. “But scientists have to understand the stability of these bases with the solvents as well,” Yang says.C&EN Aug. 19, 2019