HS_hendrix
HS_hendrix

Reputation: 99

ember electron:package build failed, caused by ember-browserify

when I want to build my ember electron app with ember electron:package I always get the error: Build failed.

File: assets/vendor.js (91129:6)

    The Broccoli Plugin: [UglifyWriter] failed with:

followed by several lines of "Error at...:" (always within node_modules)

I could figure out that it must have something to do with ember-browserify. I am importing this node module in a service.js file:

import Usabilla from 'npm:usabilla-api';

The curious thing is, that with ember electron (like ember serve) everything is fine and I can use the node module without any errors. Issues only occur when I want to package the app to the .dmg and exe files for distribution.

What am I missing ? Thanks for any help or hints!

Upvotes: 1

Views: 167

Answers (2)

Rinku Choudhary
Rinku Choudhary

Reputation: 2241

I just create the demo app in c drive and it's working perfectly.

Upvotes: 0

Adam Cooper
Adam Cooper

Reputation: 8687

Your build is failing on the minification step. Possibly because of the size of one of the packages you're pulling in or because it's already been minified. Minification only happens when you're building for production or packaging which is why you're not seeing the issue when you run locally. From the EmberCLI docs on minification, where you'll find more on the minifaction step:

the js-files are minified with broccoli-uglify-js in the production-env by default. You can pass custom options to the minifier via the minifyJS:options object in your ember-cli-build

You can exclude specific files/resources that are causing problems:

To exclude assets from dist/assets from being minificated, one can pass options for broccoli-uglify-sourcemap

Upvotes: 1

Related Questions