TypeError: Property 'scrollTo' of object [object global] is not a function #2272

Closed
ocatteau opened this Issue Apr 1, 2013 · 12 comments

Projects

None yet
@ocatteau
ocatteau commented Apr 1, 2013

It seems there is a problem on Chrome (tested on Mac and Windows - Version 26.0.1410.43 m). You can try on this page : http://docs.angularjs.org/tutorial
The backward functionnality also doesn't work anymore. It's certainly due to the same bug.

Here is the stacktrace picked from the console :

TypeError: Property 'scrollTo' of object [object global] is not a function
at g (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:30:3)
at Object.e.$eval (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:87:347)
at Object.e.$digest (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:85:198)
at Object.e.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:87:506)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:16:21
at Object.d as invoke
at qb (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:15:454)
at jc (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:15:315)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:161:402
at HTMLDocument.a (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:116:223)

Thanks !

@4lk4tr43

I get the exact same error trace as long as I have my popup blocker activated ("better popup blocker").

@ghost
ghost commented May 10, 2013

Is there any other way to solve this issue? Asking thousands of customers to turn off their popup blocker isnt really an options. Thanks in advance

@rowild
rowild commented May 28, 2013

I second that: deactivating PopUpBlocker makes that error disappear, but that's not a way to go. I am on Chrome 27.

@stormpat

I have the same issue.. I think this could be a tough problem to solve, because its not directly Angulars "fault", maybe this issue should be discussed with popupblockers devs.

@vlada-j
vlada-j commented Jun 22, 2013

Same problem...

@antoniomacs

same

@woopsa
woopsa commented Nov 4, 2013

a remedy for this is to just add a script with an empty function before loading angular.js
Like this:
window.scrollTo = function() {};

Edit: comment engine didnt like my script tags :)

@fizerkhan

I too face this problem in certain Windows machine, not all the machine. But in Mac, it works fine.

@IgorMinar
Member

I can't reproduce this. Is this still an issue? if so can you create a plnkr.co with a reduction?

@vlada-j
vlada-j commented Jan 8, 2014

In my case the problem is made by Chrome plugin "Better Pop Up Blocker". Earlier it was reported the this error, but now I not see this error in the console.

Last year I discussed about this with Josh David Miller in this post:
https://plus.google.com/107119852442751861456/posts/ChhuHHVqu31

@fwielstra
Contributor

Yeah, I've had a similar issue in a completely different project. A fix would be to simply check if .scrollTo() exists and is callable. I think there's a few ad blocker-like extensions that simply remove .scrollTo instead of replace it with a no-op.

@btford btford removed the gh: issue label Aug 20, 2014
@Narretz
Contributor
Narretz commented Feb 29, 2016

As this happens only when 3rd party code breaks DOM apis, it doesn't make a lot of sense to fix this in angular. And the offending plugin doesn't seem to exist anymore, either.

@Narretz Narretz closed this Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment