# Deprecation warning: modified twice in a single render

**URL:** <https://discuss.emberjs.com/t/deprecation-warning-modified-twice-in-a-single-render/8945>\
**Category:** Uncategorized\
**Created:** [October 10, 2015, 9:06am UTC](https://discuss.emberjs.com/t/deprecation-warning-modified-twice-in-a-single-render/8945 "2015-10-10T09:06:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgish](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/kgish/32/13333_2.png) [@kgish](https://discuss.emberjs.com/u/kgish)\
**Post date:** [October 10, 2015, 9:06am UTC](https://discuss.emberjs.com/t/deprecation-warning-modified-twice-in-a-single-render/8945/1 "2015-10-10T09:06:06Z")

</div>

I’m getting the following deprecation warning:

```auto
You modified XXX twice in a single render. This was unreliable in Ember 1.x \
and will be removed in Ember 2.0

```

I understand what it means, but what’s the best way to pinpoint the exact spot in the code that is causing this so that I can repair it?

---

<div class="post-metadata">

**Author:** ![jasonmit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasonmit/32/182_2.png) [@jasonmit](https://discuss.emberjs.com/u/jasonmit)\
**Post date:** [October 11, 2015, 7:48am UTC](https://discuss.emberjs.com/t/deprecation-warning-modified-twice-in-a-single-render/8945/2 "2015-10-11T07:48:07Z")

</div>

You could walk the call stack where the error happens to see what the property is that is being set to clue you in as to where. But, it’s likely within a `didInsertElement` hook.

It’s frustrating when you have potentially a large number of components on the screen to figure out which didInsertElement hook is doing a `set`

---

<div class="post-metadata">

**Author:** ![kgish](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/kgish/32/13333_2.png) [@kgish](https://discuss.emberjs.com/u/kgish)\
**Post date:** [October 11, 2015, 1:27pm UTC](https://discuss.emberjs.com/t/deprecation-warning-modified-twice-in-a-single-render/8945/3 "2015-10-11T13:27:00Z")

</div>

Thanks for the tip, but looking though all steps in the stack trace doesn’t help much:

```auto
DEPRECATION: You modified each(listOrderBy) twice in a single render. \
This was unreliable in Ember 1.x and will be removed in Ember 2.0
  at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:71525:7)
  at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:71611:7)
  at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:71525:7)
  at handleDeprecationWorkflow (http://localhost:4200/assets/vendor.js:71663:9)
  at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:71525:7)
  at deprecationCollector (http://localhost:4200/assets/vendor.js:71685:5)
  at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:71525:7)
  at invoke (http://localhost:4200/assets/vendor.js:71537:7)
  at Object.deprecate (http://localhost:4200/assets/vendor.js:71616:5)

```

or do you see something that I missed?

I suspect that in my template somewhere a given parameter is being changed more than once, but there are alot to choose from.

Or I could be firing off more than one bounded function properties?

To investigate this, I set a breakpoint at the only place where I’m call `this.set('listOrder')` and I see that it’s only reached once, sometimes not all all, but the deprecation message is still being generated.

---

<div class="post-metadata">

**Author:** ![workmanw](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/workmanw/32/14929_2.png) [@workmanw](https://discuss.emberjs.com/u/workmanw)\
**Post date:** [October 11, 2015, 2:16pm UTC](https://discuss.emberjs.com/t/deprecation-warning-modified-twice-in-a-single-render/8945/4 "2015-10-11T14:16:54Z")

</div>

We’ve had this a bit in our app with upgrading to Ember 2.x. There are two primary things that seem to cause this (for us):

1. A prior crash in the runloop (before the rendering cycle).
2. Modifying a property on a component in the `didInsertElement` hook and that property causes changes to something bound in the template.

I know this isn’t really helpful. One thing you could try is setting a breakpoint where the expectation is actually raised. I’ve found that part of the stack is usually helpful because it usually has the `set` call that trigger it in the stack.

---

<div class="post-metadata">

**Author:** ![kgish](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/kgish/32/13333_2.png) [@kgish](https://discuss.emberjs.com/u/kgish)\
**Post date:** [October 11, 2015, 6:15pm UTC](https://discuss.emberjs.com/t/deprecation-warning-modified-twice-in-a-single-render/8945/5 "2015-10-11T18:15:10Z")

</div>

Also set break point where the deprecation is being raised, but because it is in the run loop it’s impossible for me to know what and when that was put there previously.

---

<div class="post-metadata">

**Author:** ![jasonmit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasonmit/32/182_2.png) [@jasonmit](https://discuss.emberjs.com/u/jasonmit)\
**Post date:** [October 12, 2015, 12:03am UTC](https://discuss.emberjs.com/t/deprecation-warning-modified-twice-in-a-single-render/8945/6 "2015-10-12T00:03:58Z")

</div>

Whatever is mutating `listOrderBy` is where I would be looking. Likely within a didInsertElement hook.
