Boaz
Boaz

Reputation: 5084

determining location of deprecation warning on Ember.js

I upgraded to Ember 1.18 and I'm getting:

DEPRECATION: Using currentWhen with {{link-to}} is deprecated in favor of `current-when`.
        at Ember.LinkView.EmberComponent.extend.init (http://example.com:8000/static/assets/vendor.js:33811:15)
        at apply (http://example.com:8000/static/assets/vendor.js:32885:32)
        at superWrapper [as init] (http://example.com:8000/static/assets/vendor.js:32459:15)
        at apply (http://example.com:8000/static/assets/vendor.js:32885:32)
        at new Class (http://example.com:8000/static/assets/vendor.js:47485:9)
        at Function.Mixin.create.create (http://example.com:8000/static/assets/vendor.js:47943:16)
        at CoreView.extend.createChildView (http://example.com:8000/static/assets/vendor.js:56278:23)
        at Object.merge.appendChild (http://example.com:8000/static/assets/vendor.js:54369:26)
        at CoreView.extend.appendChild (http://example.com:8000/static/assets/vendor.js:56161:34)

None of the traceback is my code, and I'm mainly using {link-to-animated} (without currentWhen explicitly).

How can I figure out where to find the problematic code?

Upvotes: 1

Views: 327

Answers (1)

GJK
GJK

Reputation: 37379

The deprecation notice isn't showing a traceback to your code because the issue isn't in your code. :) Take a look at ember-animated-outlet.js and you'll see that currentWhen is used internally.

There's a few dirty tricks to silence deprecation warnings, but I would suggest just submitting a pull-request to the repo to have it changed. It should be a fairly easy fix.

EDIT: It seems there's already a pull request for that, but it hasn't been merged yet. So about those dirty tricks... If you're bugged by the deprecation warning, you can always override Ember.deprecate. Put the following somewhere before your app code is run (maybe in a vendor script):

var oldDeprecate = Ember.deprecate;
Ember.deprecate = function(message) {
    if (message.indexOf('currentWhen') >= 0) {
        return;
    }

    return oldDeprecate.apply(this, arguments);
};

Upvotes: 3

Related Questions