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

{{render 'navigation'}} won't render navigation.hbs if navigation view is present #10760

Closed
e00dan opened this issue Mar 29, 2015 · 26 comments · Fixed by #10822
Closed

{{render 'navigation'}} won't render navigation.hbs if navigation view is present #10760

e00dan opened this issue Mar 29, 2015 · 26 comments · Fixed by #10822

Comments

@e00dan
Copy link
Contributor

e00dan commented Mar 29, 2015

In Ember 1.12-beta1 {{render 'navigation'}} won't render navigation.hbs if navigation view is present. If I rename navigation view to something else template is being rendered. However I need both view and template. I have more render template + view situations in my app. Is this regression or wanted effect?

When views/navigation is present it uses only this file, doesn't care about template(nav tagName is specified in navigation.coffee):
zrzut ekranu z 2015-03-29 15 03 14

When there is no view with navigation name(only template rendered):
zrzut ekranu z 2015-03-29 15 02 35

In Ember.js 1.11-beta5 it works as expected(view combined with template):
zrzut ekranu z 2015-03-29 15 06 20

In Ember 1.12-beta1 I have to specify templateName: 'navigation' in my view/navigation to make it work as expected.

@mixonic
Copy link
Member

mixonic commented Mar 29, 2015

@kuzirashi sounds like a regression. A simple reproduction with emberjs.jsbin.com would be helpful, thanks.

@e00dan
Copy link
Contributor Author

e00dan commented Mar 29, 2015

@mixonic
Ok so it's actually present in 1.11 stable not in 1.12(I mean it's earlier in 1.11, not 1.12 fault).

Ember 1.10 working fine:
http://jsbin.com/sadugonero/2

Ember 1.11 bad:
http://emberjs.jsbin.com/tasutuduqo/3

And gratis Ember 1.11 + templateName specified in view working fine:
http://jsbin.com/cirasesawo/2

Also I have {{render 'player'}} inside playlist template which is rendered with {{render 'playlist'}} and I have to remove {{render 'player'}} inside playlist template because seems like {{render}} inside {{render}} is broken. Doesn't matter if player view has any template specified:
zrzut ekranu z 2015-03-29 15 36 43

playlist.hbs:

{{render 'player'}}
<div class="queues">
  <div class="queue">
     ...

I should probably be using components but it is somewhat old code and should just work.

#edit So I started to refactor {{render 'player'}} to music-player component and:
playlist.hbs:

{{music-player}}
<div class="queues">
  <div class="queue">
     ...

Works fine.

@hemp
Copy link

hemp commented Mar 29, 2015

I think I hit the same thing when moving to 1.11.0 stable from 1.11.0-beta.5 when leveraging the {{render ".."}} helper (we'll have to switch it to a component soon enough).

Chrome Canary has a better error: TypeError: pointer._parentOutlet is not a function

ember.debug.js:18946: while (pointer && (po = pointer._parentOutlet())) {

@e00dan
Copy link
Contributor Author

e00dan commented Mar 29, 2015

Demos to recreate my and @hemp issue:

Nested {{render}} working in Ember 1.10:
http://jsbin.com/beceverobe/3

Nested {{render}} not working in Ember 1.11:
http://jsbin.com/beceverobe/2

@MichaelVdheeren
Copy link

+1, having same problems

@manufaktor
Copy link

I'm having the same problem. I can work around it by explicitly setting the templateName in the view.

@EmergentBehavior
Copy link

Also running into this issue in 1.11 but, like @manufaktor, I'm finding if you explicitly specify controller and templateName etc. (as appropriate) I no longer have issues.

@Kerrick
Copy link
Contributor

Kerrick commented Mar 30, 2015

I've also been bitten by this bug in the upgrade to Ember 1.11 from Ember 1.10.

@awaer
Copy link

awaer commented Mar 30, 2015

Confirmed here. Broken in 1.11 (unless templateName is explicitly defined on view); works in 1.11.0-beta.5.

@davidpett
Copy link
Contributor

having this issue too

@rwjblue
Copy link
Member

rwjblue commented Mar 30, 2015

Looks related to #10710 (comment) (which was addressed in #10712).

@davidpett
Copy link
Contributor

thanks @rwjblue! so the expected behavior is to always define the templateName in the View? This is a change from past behavior where it would automatically grab the template based on the name of the view.

@rwjblue
Copy link
Member

rwjblue commented Mar 30, 2015

@davidpett - Yes, I am now questioning the change made in #10712. This seems to be a regression, though it does solve the issue from #10710.

I will try to dig into this tonight/tomorrow morning, and try to fix both the issue in #10710 and not break this use case.

@awaer
Copy link

awaer commented Mar 30, 2015

@rwjblue I'm also seeing some errors in impersonateAnOutlet even after I've defined templateName on the view, where pointer._parentOutlet is not a defined function.

@davidpett
Copy link
Contributor

thanks @rwjblue

@awaer
Copy link

awaer commented Mar 30, 2015

@rwjblue Here is an example of the error described in my previous comment: http://emberjs.jsbin.com/feyakinure/1/edit?html,js,output

@Adriaaaaan
Copy link

my app is totally broken by this but I've already started using the new {{component}} helper (which is awesome btw). Any chance of a patch release?

@Adriaaaaan
Copy link

as far as I can tell it just breaks because its trying to find the top level "outlet" but doesn't stop when it finds it?
adding an undefined check seems to fix it for me

in function impersonateAnOutlet(currentView, view, name)

    while (pointer && pointer._parentOutlet!=undefined && (po = pointer._parentOutlet())) {

that might be a hack but when the method has this comment
// Megahax to make outlets inside the render helper work, until we
// can kill that behavior at 2.0.

it probably cant be worse ;)

@trek
Copy link
Member

trek commented Mar 31, 2015

@Adriaaaaan the bug fix should appear in the next point release after a fix lands on master 🚋 🚋 🚋 Until then, please use the previous release you were using.

@marcemira
Copy link

Same problem here

@tonywok
Copy link

tonywok commented Apr 1, 2015

Anyone have a workaround for apps using a pod structure?

@rwjblue
Copy link
Member

rwjblue commented Apr 3, 2015

Sorry for the delay here #10822 should fix this.

@trek
Copy link
Member

trek commented Apr 3, 2015

Closing in favor of #10822. Let us know if that doesn't resolve the issue for you.

@trek trek closed this as completed Apr 3, 2015
@manufaktor
Copy link

Thanks! 👍

@awaer
Copy link

awaer commented Apr 4, 2015

@rwjblue With 1.11.1, I'm still seeing a TypeError: undefined is not a function error with a nested {{render}} -- was this addressed as a part of the fix here? It seems that the problem described above where pointer._parentOutlet() is undefined is still happening. You can see the error triggered in this example.

@rwjblue
Copy link
Member

rwjblue commented Apr 4, 2015

@awaer - Please open another issue to track this (definitely seems like a regression upon initial perusal of the JSBin you provided).

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

Successfully merging a pull request may close this issue.