【问题标题】:Can't find line causing Deprecation warning找不到导致弃用警告的行
【发布时间】:2015-04-12 17:38:32
【问题描述】:

我的 Rails/Ember 应用当前使用 ember 版本 1.5.1。我想把它带到 Ember 的最后一个版本,我这样做是通过一次更新一个版本来实现的,这样我就可以获得所有弃用警告并在继续之前修复它们。当我尝试从版本 1.6.1 升级到版本 1.7.1 时,我收到以下弃用警告,但我无法在我的应用程序中找到我在应用程序实例上使用的任何地方。

您对我如何调查和找到 then 的这种用法有什么建议吗?提供的堆栈跟踪对我没有任何用处。

DEPRECATION: Do not use `.then` on an instance of Ember.Application.  Please use the `.ready` hook instead.
    at Namespace.extend.then (http://localhost:3000/assets/ember.js?body=1:2861:15)
    at apply (http://`localhost:3000`/assets/ember.js?body=1:18384:27)
    at superWrapper [as then] (http://localhost:3000/assets/ember.js?body=1:17961:15)
    at tryThen (http://loDEPRECATION: Do not use `.then` on an instance of Ember.Application.  Please use the `.ready` hook instead.
    at Namespace.extend.then (http://localhost:3000/assets/ember.js?body=1:2861:15)
    at apply (http://localhost:3000/assets/ember.js?body=1:18384:27)
    at superWrapper [as then] (http://localhost:3000/assets/ember.js?body=1:17961:15)
    at tryThen (http://localhost:3000/assets/ember.js?body=1:45661:14)
    at http://localhost:3000/assets/ember.js?body=1:45670:21
    at http://localhost:3000/assets/ember.js?body=1:29072:9
    at DeferredActionQueues.invoke (http://localhost:3000/assets/ember.js?body=1:635:18)
    at Object.DeferredActionQueues.flush (http://localhost:3000/assets/ember.js?body=1:685:15)
    at Object.Backburner.end (http://localhost:3000/assets/ember.js?body=1:148:27)calhost:3000/assets/ember.js?body=1:45661:14)
    at http://localhost:3000/assets/ember.js?body=1:45670:21
    at http://localhost:3000/assets/ember.js?body=1:29072:9
    at DeferredActionQueues.invoke (http://localhost:3000/assets/ember.js?body=1:635:18)
    at Object.DeferredActionQueues.flush (http://localhost:3000/assets/ember.js?body=1:685:15)
    at Object.Backburner.end (http://localhost:3000/assets/ember.js?body=1:148:27)

【问题讨论】:

  • 你在做一些时髦的事情,比如wait(app)Ember.run(app)?我猜这是一些异步逻辑+运行循环的问题。否则,只需开始分类(注释掉所有应用程序,看看可以加载哪些部分,缩小范围)。
  • 您有正在使用的 Ember 特定插件或库吗?如果是这样,您介意发布名称和版本吗?

标签: ember.js


【解决方案1】:

debugging page 上找到这个:

Ember.run.backburner.DEBUG = true;

希望它为您提供导致问题的代码的完整回溯。

【讨论】:

    猜你喜欢
    • 2016-09-24
    • 2022-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-28
    相关资源
    最近更新 更多