我尝试将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
任何帮助?
答案 0 :(得分:1)
您发布的回购包含许多对document
和window
的引用。您必须使用ember provided facility for detecting the current environment
details并根据您的页面是否在浏览器中呈现来实现条件逻辑。您可以使用environment.hasDOM
执行该检查。