@ahmadnasriya this is not an issue, it’s because you call the function scrollTo by itself and it should be bound to an object
Checkout : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind
you can probably solve that issue with
const element =$w('#element');
const scrollTo =$w('#element').scrollTo;
const scrollToBound = scrollTo(element);
scrollToBound();// To be tested
Another read: Function binding