ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Getting Error: You attempted to render into '" + into + "' but it was not found"

Open drobannx opened this issue 11 years ago • 29 comments

Running into an issue since upgrading to 1.11 regarding code that changed when using this.render from a route. I'm using the ember-modals addon which makes a call to this.render from a route with a template name and some options specifying how to render the template. The issue is that appendOrphan gets called when using this.render. It seems like appendOrphan expects a call to be made to impersonateAnOutlet which would set the wasUsed value. But it looks like impersonateAnOutlet only gets called when using the {{render}} helper.

drobannx avatar Mar 31 '15 11:03 drobannx

I believe there is a duplicate issue regarding this. Can you check for us?

trek avatar Mar 31 '15 12:03 trek

I've seen some other issues that are related but I didn't find anything exactly the same. Issues #10760 and #10602 seemed related to what is going on here.

drobannx avatar Mar 31 '15 12:03 drobannx

I believe I've recreated the issue in a couple jsbins.

Ember 1.10: http://jsbin.com/zoxape/4/edit?html,js,output Ember 1.11: http://jsbin.com/bohoge/3/edit?html,js,output

drobannx avatar Mar 31 '15 13:03 drobannx

I'm getting the same error :/

dukex avatar May 13 '15 20:05 dukex

@drobannx - Can you update the JSBin for 2.0.0, and confirm this is still an issue?

rwjblue avatar Aug 16 '15 20:08 rwjblue

@rwjblue I've made a 2.0.0 bin, and I still get the issue.

Ember 1.10.0: http://jsbin.com/zoxape/4/edit?html,js,output (working) Ember 2.0.0: http://jsbin.com/wifuquzovo/edit?html,js,output (get the error)

drobannx avatar Aug 17 '15 13:08 drobannx

I can confirm that this pretty annoying bug is still here in Ember 2.3.1. With this bug still alive I can not find an easy and clean way to render things into some alternative layout (other then application.hbs)

akozhemiakin avatar Feb 07 '16 10:02 akozhemiakin

I'm having same problem on Ember 2.3.1. I'm using pod structure for my app.

Update: Okay I've made that working with a bit of workaround. I'm calling render in mixin attached to application route (it's for showing modal content). When I tried to render same template in some custom route then I had the error. My fix was to attach the mixin to this route, so now action is not bubbling to application route where it was failing. Althought it works now I still see error in console.

dzbo avatar Feb 12 '16 09:02 dzbo

+1 exactly the same bug on 2.3.0.

SeyZ avatar Feb 25 '16 10:02 SeyZ

+1 2.4.1

iAchilles avatar Mar 02 '16 19:03 iAchilles

Hello,

It seems this bug is almost 1y old. Since it seems it's not going to be fixed any time soon, is there any workaround ?

My use case is to render some route in an other layout than application. For example the login page, as it is rather independent wrt to the rest of the application.

This is my renderTemplate() overload code:

this.render('login', {
      into: 'unauthenticated'
});

I have an unauthenticated.hbs file in the templates directory, so I think I'm not doing anything wrong.

Please advise.

Thanks

xaqq avatar Mar 09 '16 13:03 xaqq

As for me I use pretty dirty warkaround: I have scrpit that conpletely removes any surrounding layout when activated. Yes, I know it's very dirty but at least it works.

akozhemiakin avatar Mar 09 '16 15:03 akozhemiakin

I actually introduced a my-body component that is rendered inside application.hbs. The my-body component makes use of a service to remove the layout (using {{#if}}) when required.

It seems similar to what you are doing, but sadly feels rather hacky. At least it works.

xaqq avatar Mar 09 '16 15:03 xaqq

Could someone provide an example of fix?( using jsbin or something else)

vzhukovsky avatar Jun 03 '16 08:06 vzhukovsky

Bump.

The issue is still present on 2.7 beta.

xaqq avatar Aug 29 '16 14:08 xaqq

Checking in from 2.7 release.

meteormanaged avatar Sep 07 '16 19:09 meteormanaged

Having this issue on 2.4.0

weedgrease avatar Sep 29 '16 23:09 weedgrease

I have the same problem

here is my twiddle

https://ember-twiddle.com/5545ecd06bb4e876a9e16644396814aa

/show2 works with application.hbs perfect /show1 must render in newLayout.hbs (without application.hbs), doest work

denniscastro avatar Oct 24 '16 17:10 denniscastro

For people who are wondering why this bug is still open: this bug has lingered at low priority because only a small minority of apps use into, and only a small minority of those attempt to do it at the top level, and none of the people working on those apps have stepped forward to fix it.

I would have killed into entirely at 2.0 if I could have -- it survived only because nobody had the time to properly deprecate and remove it. Instead we were able to keep it working, but there have always been rough edge cases and it was hard to keep 100% of them the same as the implementation changed. Each time we have poked this code again we break a different subset of rarely-used edge cases.

Just stop using into. It dates from a time when Ember had neither components nor services. Anything it can do can be done better with components and services.

For rendering to modals and sidebars, see https://github.com/ef4/ember-elsewhere

For trying to not show the application.hbs template sometimes: don't do that, you're abusing the meaning of application.hbs. It is literally supposed to be the template that is always present. Move your sometimes-present content into a child route below it (and remember that routes can have {path: '/' }, meaning your URL structure is unrelated to this change).

ef4 avatar Oct 24 '16 18:10 ef4

This issue is still present on 2.10.0 release!

neilor avatar Dec 20 '16 03:12 neilor