Herein we have reported a blue LED mediated reaction of aryl diazoacetate with a stoichiometric amount of 1,4-dioxane/tetrahydropyran (THP) and various heterocycles like indoles, pyrroles, phthalimides, thiazolidinediones and hydantoins in water. During the reaction, various aryl diazoacetates were converted to oxonium ylides by reacting with 1,4-dioxane and THP. These ylides generated in aqueous medium (under metal- and base-free conditions) were then used for the amino etherification of the aforementioned heterocycles in excellent yield. The ylides underwent a [1,2] shift to afford substituted 1,4-dioxepanes. Phthalimide products were also converted to 1,4,7-dioxazonan-6-ones. Reaction kinetics, Hammett's plot and DFT calculations (solvent phase) rationalize the ylide formation and subsequent reactions with the nucleophiles. The reaction was also demonstrated at the multigram scale. This amino etherification reaction of aryl diazoacetates in aqueous medium demonstrated a sustainable process of converting toxic 1,4-dioxane in functionalizing heterocycles. This journal is © The Royal Society of Chemistry.