ember-cli失败--environment = production(未捕获错误:找不到模块) [英] ember-cli fails on --environment=production (Uncaught Error: Could not find module)

查看:257
本文介绍了ember-cli失败--environment = production(未捕获错误:找不到模块)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ember-cli,并且在选择生产环境方面有问题。具体来说,当我运行 ember serve --environment = development 时,一切都会起作用,当我运行时,我得到一个空白页面ember serve --environment = production 。在控制台中,我看到:

I am using ember-cli and have a problem with selecting the production environment. Specifically, everything works when I run ember serve --environment=development and I get a blank page when I run ember serve --environment=production. In the console, I see:


  • 未捕获TypeError:未定义不是函数

  • 未捕获错误:找不到module simple-auth / authenticators / base

所有其他的事情是相等的,所有的依赖关系都是最新的。我是一个总的noob,所以我甚至不知道从哪里开始如何调试:它是否是ember?烬-CLI?西兰花?

All other things are equal, and all dependencies are up to date. I'm a total noob so I don't even know where to begin on how to debug: is it ember? ember-cli? broccoli? Any help would be appreciated.

推荐答案

解决方案是


这是有点不规范和不鼓励,但假设由于您的应用程序的要求,您需要使用完整版本的Handlebars即使在生产环境。

This is somewhat non-standard and discouraged, but suppose that due to a requirement in your application that you need to use the full version of Handlebars even in the production environment.

基本上,您可以将 vendorFiles 选项传递给您的 EmberApp 实例,这将强制CLI包括Handlebars的完整版本。

Basically, you can pass vendorFiles option to your EmberApp instance which will force CLI to include full version of Handlebars.

中明确要求 handlebars.js 的示例Brocfile.js

Example of explicitly requiring handlebars.js , in Brocfile.js:

var app = new EmberApp({
  vendorFiles: {
    'handlebars.js': {
      production: 'bower_components/handlebars/handlebars.js'
    }
  }
});

这是解决此问题的建议方法( GitHub讨论)。

This is recommended way of solving this issue(discussion on GitHub).

这篇关于ember-cli失败--environment = production(未捕获错误:找不到模块)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆