wyraźny przedział E.close nie jest funkcją

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