简体   繁体   English

灰烬生成由于broccoliBuilderError而失败

[英]Ember build failed because of broccoliBuilderError

I am on an ember project and I am trying to upgrade ember version from 2.8 to 3.5.0. 我正在执行余烬项目,并且我正在尝试将余烬版本从2.8升级到3.5.0。 But since I changed the version and also some several dependencies version I get this error : 但是由于我更改了版本以及一些依赖项版本,所以出现此错误:

Error stack 错误堆栈

I've tried to fix this with ember-cli-build file but the error persisted. 我试图用ember-cli-build文件修复此问题,但错误仍然存​​在。

const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
    const isPublicEnv = EmberApp.env() === 'public';

    const app = new EmberApp(defaults, {

        'sassOptions': {
            includePaths: [
                'bower_components/materialize/sass',
            ],
        },
        'outputPaths': {
            app: {
                css: {
                    design1: '/assets/design1.css',
                    design2: '/assets/design2.css'
                },
            },
        },
        'ember-cli-babel': {
            includePolyfill: true,
        },
        'minifyJS': {
            enabled: isPublicEnv,
        },
        'minifyCSS': {
            enabled: isPublicEnv,
        },
        'fingerprint': {
            enabled: isPublicEnv,
        },
        'tests': !isPublicEnv,
        'hinting': !isPublicEnv,
        'sourcemaps': {
            enabled: !isPublicEnv,
        },
    });

    app.import('vendor/lib1.js');
    app.import('vendor/lib2.js');

    return app.toTree();
};

Any suggestion to resolve this ? 有什么建议解决这个问题吗?

This is the code that's failing from your stack trace from ember-cli-htmlbars-inline-precompile : 这是从ember-cli-htmlbars-inline-precompile的堆栈跟踪中失败的代码:

templateCompilerPath() {
    let config = this.projectConfig();
    let templateCompilerPath = config['ember-cli-htmlbars'] && config['ember-cli-htmlbars'].templateCompilerPath;

    let ember = this.project.findAddonByName('ember-source');
    if (ember) {
      return ember.absolutePaths.templateCompiler;
    }

    return path.resolve(this.project.root, templateCompilerPath);
}

This line let ember = this.project.findAddonByName('ember-source'); 这行let ember = this.project.findAddonByName('ember-source'); must be the culprit. 一定是罪魁祸首。 Although Ember switched from bower to npm around 2.11 iirc, the only way you could be getting Ember > 3.0 is via npm since the last bower pushed version was the end of 2.x . 尽管Ember在2.11 iirc左右从bower切换到npm,但是使ember> 3.0的唯一方法是通过npm,因为上一个bower pushed版本是2.x的结尾。

I suspect you are on an old version of ember-cli that needs to also be updated since ember is not found. 我怀疑您使用的是ember-cli的旧版本,由于未找到ember ,因此也需要更新。 Which version of ember-cli are you using? 您正在使用哪个版本的ember-cli

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM