Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use this at all in Firefox #1104

Closed
pocesar opened this issue May 27, 2014 · 8 comments
Closed

Can't use this at all in Firefox #1104

pocesar opened this issue May 27, 2014 · 8 comments

Comments

@pocesar
Copy link

pocesar commented May 27, 2014

I'm using latest version of ui-router, with Angular 1.3.0-beta.10, jQuery 2.1.1, and everytime I bootstrap my module in Firefox, I receive a "Error: too much recursion", with a useless stack trace:

jQuery.fn.extend@http://localhost/bower_components/jquery/dist/jquery.js:228 (this repeats undefinitely)
wrap/<@http://localhost/#/planos:13 
updateView@http://localhost/bower_components/angular-ui-router/release/angular-ui-router.js:2742 
$ViewDirective/directive.compile/</<@http://localhost/bower_components/angular-ui-router/release/angular-ui-router.js:2697 
$RootScopeProvider/this.$get</Scope.prototype.$broadcast@http://localhost/bower_components/angular/angular.js:12860 
transitionTo/$state.transition<@http://localhost/bower_components/angular-ui-router/release/angular-ui-router.js:2114 
qFactory/defer/deferred.promise.then/wrappedCallback@http://localhost/bower_components/angular/angular.js:11410 
qFactory/ref/<.then/<@http://localhost/bower_components/angular/angular.js:11496 
$RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost/bower_components/angular/angular.js:12575 
$RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost/bower_components/angular/angular.js:12379 
$RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost/bower_components/angular/angular.js:12679 
done@http://localhost/bower_components/angular/angular.js:8279 
completeRequest@http://localhost/bower_components/angular/angular.js:8484 
createHttpBackend/</xhr.onreadystatechange@http://localhost/bower_components/angular/angular.js:8427
consoleLog/<()angular.js (line 10062)
$ExceptionHandlerProvider/this.$get</<()angular.js (line 7363)
$RootScopeProvider/this.$get</Scope.prototype.$broadcast()angular.js (line 12862)
transitionTo/$state.transition<()angula...uter.js (line 2114)
qFactory/defer/deferred.promise.then/wrappedCallback()angular.js (line 11410)
qFactory/ref/<.then/<()angular.js (line 11496)
$RootScopeProvider/this.$get</Scope.prototype.$eval()angular.js (line 12575)
$RootScopeProvider/this.$get</Scope.prototype.$digest()angular.js (line 12379)
$RootScopeProvider/this.$get</Scope.prototype.$apply()angular.js (line 12679)
done()angular.js (line 8279)
completeRequest()angular.js (line 8484)
createHttpBackend/</xhr.onreadystatechange()angular.js (line 8427)

I'm stumped. The application itself is somewhat big (around 10k lines of code), but it's a SPA. It works on Chrome...

EDIT: It doesn't work on Firefox WHEN FIREBUG is opened. So I guess it's a bug in Firebug, but it didn't happen with ngRoute

@pocesar pocesar changed the title Can't use this at all Can't use this at all in Firefox May 27, 2014
@pocesar
Copy link
Author

pocesar commented May 31, 2014

By using the step-by-step debugger in Firebug, this is the endless loop:

init(selector=address.container, context=undefined) jquery.js (line 2712)
jQuery(selector=address.container, context=undefined) jquery.js (line 76)
compositeLinkFn(scope=Scope { $id="002", $$childTail=Scope, $$childHead=Scope, more...}, nodeList=NodeList[<TextNode textContent="\n ">, address.container, <TextNode textContent="\n ">], $rootElement=undefined, boundTranscludeFn=undefined) angular.js (line 6091)
compositeLinkFn(scope=Scope { $id="002", $$childTail=Scope, $$childHead=Scope, more...}, nodeList=NodeList[<TextNode textContent="\n\n ">, header.clearfix, <TextNode textContent="\n\n ">, 66 more...], $rootElement=undefined, boundTranscludeFn=undefined) angular.js (line 6109)
compositeLinkFn(scope=Scope { $id="002", $$childTail=Scope, $$childHead=Scope, more...}, nodeList=NodeList[Comment { data="<![endif]", length=9, nextElementSibling=head, more...}, head, <TextNode textContent="\n">, body.Home], $rootElement=undefined, boundTranscludeFn=undefined) angular.js (line 6109)
compositeLinkFn(scope=Scope { $id="002", $$childTail=Scope, $$childHead=Scope, more...}, nodeList=NodeList[DocumentType { name="html", nodeType=10, nodeName="html", more...}, Comment { data="[if lt IE 7]><html clas...lang="pt-BR"> <![endif]", length=85, nextElementSibling=html.no-ie, more...}, Comment { data="[if IE 7]><html class="...lang="pt-BR"> <![endif]", length=79, nextElementSibling=html.no-ie, more...}, 4 more...], $rootElement=undefined, boundTranscludeFn=undefined) angular.js (line 6109)
compositeLinkFn(scope=Scope { $id="002", $$childTail=Scope, $$childHead=Scope, more...}, nodeList=jQuery(Document planos), $rootElement=jQuery(Document planos), boundTranscludeFn=undefined) angular.js (line 6109)
publicLinkFn(scope=Scope { $id="002", $$childTail=Scope, $$childHead=Scope, more...}, cloneConnectFn=undefined, transcludeControllers=undefined) angular.js (line 6011)
(?)()angular.js (line 1481)
$eval(expr=function(), locals=undefined) angular.js (line 12575)
$apply(expr=function()) angular.js (line 12673)
(?)(scope=Scope { $id="002", $$childTail=Scope, $$childHead=Scope, more...}, element=jQuery(Document planos), compile=compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext), injector=Object { invoke=invoke(), instantiate=instantiate(), get=getService(), more...}, animate=Object { enter=function(), leave=function(), move=function(), more...}) angular.js (line 1479)
invoke(fn=function(), self=undefined, locals=undefined, serviceName=undefined)angular.js (line 3979)
doBootstrap() angular.js (line 1478)
bootstrap(element=jQuery(Document planos), modules=["ng", ["$provide", function()], "Base.Module"], config=Object { strictDi=false}) angular.js (line 1491)
(?)()app.js (line 1727)
fire(data=[Document planos, [function()]]) jquery.js (line 3073)
fireWith(context=Document planos, args=[Document planos, [function()]]) jquery.js (line 3185)
ready(wait=undefined) jquery.js (line 3391)
completed() jquery.js (line 3407)

If I take out angular-ui-router it works. It was already working with ngRouter. My current markup. The module is being bootstrapped manually on DOM ready

<section>
<div class="container main-container">
<!-- uiView: -->
<div class="ng-scope" autoscroll="" ui-view=""></div> {$scope=Scope { $$listeners={...}, $$listenerCount={...}, $id="004", more...}$uiViewName="@" }
</div>
</section>

@nosideeffects
Copy link

Currently, Angular doesn't support the 2.x builds of jQuery. Does it work when you include a 1.x build?
angular/angular.js@46a53b2

@pocesar
Copy link
Author

pocesar commented Jun 11, 2014

I just found out about angular not having support for jquery 2.x after changing to ui-router. it was actually working fine before

@nosideeffects
Copy link

So, to answer my own question, yes?

@pocesar
Copy link
Author

pocesar commented Jun 11, 2014

yup, working just fine

@pocesar
Copy link
Author

pocesar commented Aug 15, 2014

angular 1.3 latest beta now complies with jQuery 2.1.1+, BUT ui-router is still getting this error with new jquery, the cross reference of issues is angular/angular.js#7648

@mgol
Copy link

mgol commented Aug 15, 2014

I assume this works fine when Firebug is disabled? Does it work with Firefox built-in developer tools?

Also, I don't really understand the error; where does this recursion happen? The stack trace doesn't seem extremely long.

Note that it'll be very hard to fix if we don't have a reproducible case we could test on. But if this bug appears only in tandem with Firebug, it's much less critical than the title of this issue seems to indicate.

@pocesar
Copy link
Author

pocesar commented Aug 15, 2014

it was the firequery (firebug's plugin), now I feel stupid. disabled it and now works, doh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants