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

Maximum call stack size exceeded in 1.2.3 #219

Closed
Souldrinker opened this issue May 4, 2016 · 4 comments
Closed

Maximum call stack size exceeded in 1.2.3 #219

Souldrinker opened this issue May 4, 2016 · 4 comments

Comments

@Souldrinker
Copy link

I just updated to the latest aurelia packages and stuff broke (=app won't start). If I revert aurelia-templating-resources to 1.2.2 (leaving all the rest at latest) things start working again.

After some further comparision of what changed in the 1.2.3 release I see that if I keep 1.2.3 and only revert the implementation of behaviorRequiresLifecycle in analyze-view-factory.js as it was in 1.2.2 things start working again:

 function behaviorRequiresLifecycle(instruction) {
   var t = instruction.type;
   var name = t.elementname !== null ? t.elementname : t.attributename;
   if (lifecycleOptionalBehaviors.indexOf(name) === -1) {
       return t.handlesAttached || t.handlesBind || t.handlesCreated || t.handlesDetached || t.handlesUnbind;
   }
   return instruction.viewFactory && viewsRequireLifecycle(instruction.viewFactory);
 }

Below is the stack trace I get in the console when I use the 1.2.3 implementation of behaviorRequiresLifecycle:

aurelia-pal.js:38 Uncaught (in promise) Error: Error invoking Repeat. Check the inner error for details.

Inner Error:
Message: Maximum call stack size exceeded
Inner Error Stack:
RangeError: Maximum call stack size exceeded
at targetRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:17:35)
at viewsRequireLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:47:11)
at behaviorRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:14:247)
at targetRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:22:13)
at viewsRequireLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:47:11)
at behaviorRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:14:180)
at targetRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:22:13)
at viewsRequireLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:47:11)
at behaviorRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:14:247)
at targetRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:22:13)

End Inner Error Stack

at targetRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:17:35)
at viewsRequireLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:47:11)
at behaviorRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:14:247)
at targetRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:22:13)
at viewsRequireLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:47:11)
at behaviorRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:14:180)
at targetRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:22:13)
at viewsRequireLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:47:11)
at behaviorRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:14:247)
at targetRequiresLifecycle (http://localhost:49352/jspm_packages/npm/aurelia-templating-resources@1.0.0-beta.1.2.3/analyze-view-factory.js:22:13)

End Inner Error Stack

at new AggregateError (http://localhost:49352/jspm_packages/npm/aurelia-pal@1.0.0-beta.1.2.1/aurelia-pal.js:38:13)
at Container.invoke (http://localhost:49352/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:566:15)
at ProviderResolver.get (http://localhost:49352/jspm_packages/npm/aurelia-templating@1.0.0-beta.1.2.4/aurelia-templating.js:1604:74)
at Container.get (http://localhost:49352/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:501:23)
at Container.elementContainerGet [as get] (http://localhost:49352/jspm_packages/npm/aurelia-templating@1.0.0-beta.1.2.4/aurelia-templating.js:1659:17)
at HtmlBehaviorResource.create (http://localhost:49352/jspm_packages/npm/aurelia-templating@1.0.0-beta.1.2.4/aurelia-templating.js:3511:58)
at applyInstructions (http://localhost:49352/jspm_packages/npm/aurelia-templating@1.0.0-beta.1.2.4/aurelia-templating.js:1737:33)
at ViewFactory.create (http://localhost:49352/jspm_packages/npm/aurelia-templating@1.0.0-beta.1.2.4/aurelia-templating.js:1959:9)
at HtmlBehaviorResource.create (http://localhost:49352/jspm_packages/npm/aurelia-templating@1.0.0-beta.1.2.4/aurelia-templating.js:3523:41)
at http://localhost:49352/jspm_packages/npm/aurelia-templating@1.0.0-beta.1.2.4/aurelia-templating.js:3908:18
@valichek
Copy link

valichek commented May 4, 2016

Same issue I do have it occurs when I use component recursion. I put <navitem /> inside if its own template. That is a way I build navigation tree

@EisenbergEffect
Copy link
Contributor

@jdanyow Can you look at this. Looks like we had a regression.

@vuorinem
Copy link

vuorinem commented May 4, 2016

I'm having the same issue with component recursion: https://gist.run/?id=484c034828ee4c3328e97afdc9a443d7. I also noticed that using view-only works fine (requiring the component using <require from="node.html">).

@jdanyow jdanyow closed this as completed in e9797aa May 6, 2016
@jdanyow
Copy link
Contributor

jdanyow commented May 6, 2016

@Souldrinker / @valichek / @vuorinem - there's a new build of templating-binding and templating-resources available- let me know if you run into any further issues with this release.

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

5 participants