Ember FastBoot无法读取属性' userAgent'未定义的

时间:2015-12-25 18:19:15

标签: javascript ember.js ember-cli

我尝试将Ember FastBoot用于我的应用程序,但是当我运行时: ember fastboot --serve-assets抛出此错误:

Cannot read property 'userAgent' of undefined TypeError: Cannot read property 'userAgent' of undefined at Object.125.global/document (<anonymous>:121923:53) at s (<anonymous>:104896:621) at <anonymous>:104896:672 at Object.106../big-play-button.js (<anonymous>:113849:23) at s (<anonymous>:104896:621) at <anonymous>:104896:672 at Object.139.../../src/js/utils/merge-options.js (<anonymous>:123824:15) at s (<anonymous>:104896:621) at e (<anonymous>:104896:792) at <anonymous>:104896:810

任何帮助?

1 个答案:

答案 0 :(得分:1)

您发布的回购包含许多对documentwindow的引用。您必须使用ember provided facility for detecting the current environment details并根据您的页面是否在浏览器中呈现来实现条件逻辑。您可以使用environment.hasDOM执行该检查。