Четкий интервал e.close не является функцией

It's because of your IDE! Make sure your IDE didn't include automatic imports such as
import { clearInterval } from 'timers'; 
If so, remove them. Rest should be fine.
Defeated Dingo