有关将Ember应用程序升级到2.14版的问题

时间:2017-07-07 13:59:45

标签: ember.js ember-data upgrade ember-cli

新版本的ember(2.14)存在问题。 我使用此help升级了我的项目。 我解决了一些我遇到的问题,例如:

  

转换 - > DS.Transform。

但是有一个我无法解决的错误,这是在debbuging控制台中显示的警告:

DEPRECATION: Using "_lookupFactory" is deprecated. Please use
             container.factoryFor instead. [deprecation id: container-lookupFactory]
             See http://emberjs.com/deprecations/v2.x/#toc_migrating-from-_lookupfactory-to-factoryfor for more details.
        at logDeprecationStackTrace (http://localhost:4200/assets/vendor.js:32785:21)
        at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:33003:9)
        at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:32815:14)
        at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:33003:9)
        at invoke (http://localhost:4200/assets/vendor.js:33015:9)
        at deprecate (http://localhost:4200/assets/vendor.js:32869:24)
        at Container.lookupFactory (http://localhost:4200/assets/vendor.js:29145:54)
        at Class._lookupFactory (http://localhost:4200/assets/vendor.js:57166:33)
        at Locale._compileTemplate (http://localhost:4200/assets/vendor.js:92841:32)
logDeprecationStackTrace @ deprecate.js:116
HANDLERS.(anonymous function) @ handlers.js:14
raiseOnDeprecation @ deprecate.js:128
HANDLERS.(anonymous function) @ handlers.js:14
invoke @ handlers.js:26
deprecate @ deprecate.js:182
lookupFactory @ container.js:43
_lookupFactory @ container_proxy.js:26
_compileTemplate @ locale.js:116
getCompiledTemplate @ locale.js:60
t @ i18n.js:47
compute @ boolean-to-colored-yes-no.js:9
compute @ references.js:459
value @ references.js:70
compute @ reference.js:287
value @ reference.js:256
initialize @ reference.js:337
peek @ reference.js:311
evaluate @ runtime.js:6615
(anonymous) @ runtime.js:6562
evaluate @ runtime.js:202
next @ runtime.js:6115
execute @ runtime.js:6090
resume @ runtime.js:6081
handleException @ runtime.js:6360
handleException @ runtime.js:6551
_throw @ runtime.js:6245
evaluate @ runtime.js:411
execute @ runtime.js:6232
rerender @ runtime.js:5642
_this.render @ renderer.js:68
exports.runInTransaction @ ember-metal.js:693
_renderRoots @ renderer.js:335
_renderRootsTransaction @ renderer.js:373
_revalidate @ renderer.js:412
invokeWithOnError @ backburner.js:271
flush @ backburner.js:157
flush @ backburner.js:320
end @ backburner.js:399
run @ backburner.js:478
join @ backburner.js:491
run$1.join @ ember-metal.js:4456
(anonymous) @ has_element.js:18
exports.flaggedInstrument @ ember-metal.js:3883
handleEvent @ has_element.js:17
exports.default._emberMetal.Mixin.create._Mixin$create.handleEvent @ view_support.js:260
_bubbleEvent @ event_dispatcher.js:267
(anonymous) @ event_dispatcher.js:201
dispatch @ jquery.js:5206
elemData.handle @ jquery.js:5014

我已经检查过,我没有调用_lookupFactory。

我对ember和Javascript很新。

1 个答案:

答案 0 :(得分:1)

它可能来自i18n插件。您可以在堆栈跟踪中看到:

  

t @ i18n.js:47

看起来插件所有者已经在1月修复了这个问题。您可以看到相关的拉取请求:https://github.com/jamesarosen/ember-i18n/pull/431/files

可能导致弃用的文件是:addon / utils / locale.js - 代码行:33:

const defaultConfig = this.owner._lookupFactory('ember-i18n@config:zh');

请升级您在项目中依赖的i18n版本。