Coder Social home page Coder Social logo

ember-cli-terser's Introduction

ember-cli-terser

npm Build Status

terser integration to ember-cli to minify your JavaScript.

Installation

ember install ember-cli-terser

Embroider

Note that, ember-cli-terser has no effect under Embroider, as Embroider provides its own minification process based on terser. This means that, apps using Embroider, can safely uninstall ember-cli-terser.

Usage

After installing ember-cli-terser it will automatically hook into the build pipeline and minify your JS files in production builds.

If you want to customize how ember-cli-terser is running terser under the hood you have several configuration options available:

// ember-cli-build.js

var app = new EmberApp({
  'ember-cli-terser': {
    enabled: true,

    exclude: ['vendor.js'],

    terser: {
      compress: {
        sequences: 50,
      },
      output: {
        semicolons: true,
      },
    },

    // Tell broccoli-terser-sourcemap to not add sourcemap URLs
    hiddenSourceMap: true,
  },
});

Options

  • enabled?: boolean: Enables/Disables minification (defaults to true for production builds, false for development builds)

  • exclude?: string[]: A list of paths or globs to exclude from minification

  • terser?: TerserOptions: A hash of options that are passed directly to terser

If no terser option is passed, a default configuration will be used.

Options supported by broccoli-terser-sourcemap may be added as top-level fields.

Source Maps

Source maps are disabled by default for production builds in Ember CLI. If you want to enable source maps for production builds you can configure that in your ember-cli-build.js too:

// ember-cli-build.js

var app = new EmberApp({
  sourcemaps: {
    enabled: true,
    extensions: ['js'],
  },
});

License

ember-cli-terser is licensed under the MIT License.

ember-cli-terser's People

Contributors

bertdeblock avatar dcyriller avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar greenkeeperio-bot avatar jaswilli avatar jelhan avatar jkarsrud avatar jrjohnson avatar kategengler avatar mike-engel avatar mikrostew avatar rwjblue avatar stefanpenner avatar theenadayalank avatar turbo87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-cli-terser's Issues

v4.0.2 gives build error `Unexpected token: punc (:)`

Updating to v4.0.2 gives us the following in our build logs:

error	08-Jul-2021 12:04:17	Error: Unexpected token: punc (:)
error	08-Jul-2021 12:04:17	        at TerserWriter
error	08-Jul-2021 12:04:17	-~- created here: -~-
error	08-Jul-2021 12:04:17	    at new Plugin (/node_modules/broccoli-terser-sourcemap/node_modules/broccoli-plugin/dist/index.js:47:36)

v4.0.1 is working. Are we missing a transitive dependency update? Or is there an issue with v4.0.2?

upgrade to ember 3.22

  - stack: TypeError: Cannot read property 'uglify' of undefined
  at Class.included (C:\work\ember\a\node_modules\ember-cli-terser\index.js:38:96)

    if ('ember-cli-uglify' in app.options) {
      this.ui.writeWarnLine('[ember-cli-terser] Passing options as `ember-cli-uglify` in `ember-cli-build.js` is deprecated, please update to passing `ember-cli-terser` (with a `terser` property) instead.');

      addonOptions = Object.assign({}, app.options['ember-cli-uglify'], { terser: addonOptions.uglify, uglify: undefined });
    }

and WARN not shows in console.

fix this by editing ember-cli-build.js

ember production build is failed

Version Summary:
[email protected]
two versions of moment at different path
[email protected]
[email protected]
[email protected]

=================================================================================

ENV Summary:

TIME: Mon Nov 23 2020 14:37:29 GMT+0530 (India Standard Time)
TITLE: ember
ARGV:

  • /Users/sursingh/.nvm/versions/node/v10.19.0/bin/node
  • /Users/sursingh/.nvm/versions/node/v10.19.0/bin/ember
  • build
  • --environment=production
    EXEC_PATH: /Users/sursingh/.nvm/versions/node/v10.19.0/bin/node
    TMPDIR: /var/folders/df/y8t2mcrn5dz8033nqzh2736r0000gp/T
    SHELL: /bin/bash
    PATH:
  • /Users/sursingh/.nvm/versions/node/v10.19.0/bin
  • /usr/local/bin
  • /usr/bin
  • /bin
  • /usr/sbin
  • /sbin
    PLATFORM: darwin x64
    FREEMEM: 1167257600
    TOTALMEM: 17179869184
    UPTIME: 441860
    LOADAVG: 2.833984375,3.78271484375,3.796875
    CPUS:
  • Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz - 2700
  • Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz - 2700
  • Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz - 2700
  • Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz - 2700
  • Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz - 2700
  • Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz - 2700
  • Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz - 2700
  • Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz - 2700
    ENDIANNESS: LE
    VERSIONS:
  • ares: 1.15.0
    • brotli: 1.0.7
    • cldr: 35.1
    • http_parser: 2.9.3
    • icu: 64.2
    • modules: 64
    • napi: 5
    • nghttp2: 1.39.2
    • node: 10.19.0
    • openssl: 1.1.1d
    • tz: 2019c
    • unicode: 12.1
    • uv: 1.28.0
    • v8: 6.8.275.32-node.55
    • zlib: 1.2.11

ERROR Summary:

  • broccoliBuilderErrorStack: SyntaxError: Unexpected token: eof (undefined)
    at ee (/Users/sursingh/alarms-ui/node_modules/terser/dist/bundle.min.js:1:19541)
    at c (/Users/sursingh/alarms-ui/node_modules/terser/dist/bundle.min.js:1:28244)
    at l (/Users/sursingh/alarms-ui/node_modules/terser/dist/bundle.min.js:1:28335)
    at f (/Users/sursingh/alarms-ui/node_modules/terser/dist/bundle.min.js:1:28388)
    at N (/Users/sursingh/alarms-ui/node_modules/terser/dist/bundle.min.js:1:38492)
    at /Users/sursingh/alarms-ui/node_modules/terser/dist/bundle.min.js:1:30588
    at /Users/sursingh/alarms-ui/node_modules/terser/dist/bundle.min.js:1:28976
    at /Users/sursingh/alarms-ui/node_modules/terser/dist/bundle.min.js:1:32320
    at /Users/sursingh/alarms-ui/node_modules/terser/dist/bundle.min.js:1:32430
    at /Users/sursingh/alarms-ui/node_modules/terser/dist/bundle.min.js:1:28976
  • code: [undefined]
  • codeFrame: Unexpected token: eof (undefined)
  • errorMessage: Unexpected token: eof (undefined)
    at UglifyWriter
    -- created here: --
    at UglifyWriter.Plugin (/Users/sursingh/alarms-ui/node_modules/broccoli-uglify-sourcemap/node_modules/broccoli-plugin/index.js:7:31)
    at new UglifyWriter (/Users/sursingh/alarms-ui/node_modules/broccoli-uglify-sourcemap/index.js:38:10)
    at UglifyWriter (/Users/sursingh/alarms-ui/node_modules/broccoli-uglify-sourcemap/index.js:33:12)
    at Class.postprocessTree (/Users/sursingh/alarms-ui/node_modules/ember-cli-uglify/index.js:54:50)
    at projectOrAddon.addons.reduce (/Users/sursingh/alarms-ui/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
    at Array.reduce (:null:null)
    at addonProcessTree (/Users/sursingh/alarms-ui/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
    at EmberApp.addonPostprocessTree (/Users/sursingh/alarms-ui/node_modules/ember-cli/lib/broccoli/ember-app.js:856:12)
    at EmberApp.host.addonPostprocessTree (/Users/sursingh/alarms-ui/node_modules/ember-auto-import/js/auto-import.js:108:20)
    at EmberApp.toTree (/Users/sursingh/alarms-ui/node_modules/ember-cli/lib/broccoli/ember-app.js:1788:17)
    at module.exports (/Users/sursingh/alarms-ui/ember-cli-build.js:57:14)
    at Builder.readBuildFile (/Users/sursingh/alarms-ui/node_modules/ember-cli/lib/models/builder.js:52:14)
    at Builder.setupBroccoliBuilder (/Users/sursingh/alarms-ui/node_modules/ember-cli/lib/models/builder.js:66:22)
    at new Builder (/Users/sursingh/alarms-ui/node_modules/ember-cli/lib/models/builder.js:32:10)
    at BuildTask.run (/Users/sursingh/alarms-ui/node_modules/ember-cli/lib/tasks/build.js:15:19)
    at Promise.resolve.then (/Users/sursingh/alarms-ui/node_modules/ember-cli/lib/models/command.js:239:24)
    at tryCatcher (/Users/sursingh/alarms-ui/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:326:21)

v2.0.0-beta.1 broken on Safari

Builds that are uglified with v2.0.0-beta.1 will break in safari with the error SyntaxError: Cannot declare a let variable twice: 't'.

This is actually a bug in safari Version 10 and it is fixed in Technology Preview (Release 37 (Safari 11.1, WebKit 12605.1.2).

This issues was reported upstream in UglifyJS2:
mishoo/UglifyJS#1753

I don't believe there is anything for ember-cli-uglify to do here except wait. I'm only opening an issue so beta.1 doesn't become final with a breaking change in a major browser and as a reference for anyone else trying out the beta.

Ember build development must compress js files the same as production

I have two environments.
Production and development.

Development is slow because the vendor file is 2mb and on production it is 500kb. I need development to build the same as production.

I've tried everything I could find, also setting my environment as production won't work because then my Ember app will point to production API and not development.

For example:
ember s should minify the same as ember s -prod

Thank you in advance.

CSS minification doesn't seem to work for Glimmer.js app

When I run ember build --prod the dist/app.css contents all the source files comments and there is no sign of minification.

ember-cli: 2.14.0
node: 6.9.4
os: darwin x64

I tried both 2.0.0-beta.1 and 1.2.0 versions.

ember-cli-build.js:

const GlimmerApp = require('@glimmer/application-pipeline').GlimmerApp;

module.exports = function(defaults) {
  let app = new GlimmerApp(defaults, {
    fingerprint: {
      extensions: ['js', 'css', 'png', 'jpg', 'gif', 'svg', 'ttf', 'woff'],
      exclude: ['apple-touch-icon', 'favicon', 'mstile', 'android-chrome']
    },
  });

  return app.toTree();
};

package.json:

...
  "devDependencies": {
    "@glimmer/application": "^0.7.2",
    "@glimmer/application-pipeline": "^0.8.0",
    "@glimmer/blueprint": "^0.5.0",
    "@glimmer/inline-precompile": "^1.0.0",
    "@glimmer/resolver": "^0.3.0",
    "@glimmer/test-helpers": "^0.30.0",
    "@types/qunit": "^2.0.31",
    "broccoli-asset-rev": "^2.5.0",
    "ember-cli": "^2.14.0",
    "ember-cli-autoprefixer": "^0.7.0",
    "ember-cli-dependency-checker": "^2.0.1",
    "ember-cli-inject-live-reload": "^1.6.1",
    "ember-cli-sass": "^6.2.0",
    "ember-cli-uglify": "^1.2.0",
    "qunitjs": "^2.3.3",
    "typescript": "^2.2.2"
  }

Sourcemaps broken when using fingerprinting

We've run into an issue when using ember-cli-terser and fingerprinting when building for production (or, when both are enabled). After a bit of debugging, I've nailed it down to the order that ember-cli-terser (and thus brocolli-terser-sourcemap) and broccoli-asset-rev run.

Background

Our app is written with both typescript and javascript, so the typescript compiler first compiles and creates sourcemaps for all the files, then babel runs and consumes those sourcemaps and updates them for the generated code. Then when terser runs, it consumes those sourcemaps and updates it for the minified code. Up to this point, everything works perfectly. Using source-map, I can verify that a line in the minified file correctly points to the right line and column in the original typescript file.

The problem comes right after, when broccoli-asset-rev runs. We use it to fingerprint and prepend our CDN url to assets, which changes the column of code in the minified javascript file, but doesn't update the sourcemap. This leads to a case where the line/column combination in the minified, fingerprinted file, no longer match up to the source.

Validation

I've tested this theory by turning off fingerprinting and source maps then work as expected. Additionally, if I disable ember-cli-terser but leave fingerprinting enabled, source maps also work ok. This is because the asset URL changes don't affect the column/line count of the code following it, because it's not minified and all on one line.

Source

Ultimately, I believe the source of the issue is the declaration that ember-cli-terser run before broccoli-asset-rev in the package.json config. This has been the case since v1.0.1.

Resolution

I'm not sure if there was a root reason for making ember-cli-uglify run before ember-asset-rev, but I believe it should be set to after. During my testing, I found that switching from before to after still compiles fingerprinted assets correctly, but also maintains the integrity of sourcemaps.

I hope that all made sense, and if you have questions I'd be happy to try and answer them!

Sourcemaps + fingerprinting regression with ember-cli-terser 4.0.2?

The combination of ember-cli-terser 4.0.2, sourcemaps, and asset fingerprinting with the prepend option seems broken. It works with 4.0.1.

The generated sourcemap just has a single file in its "arrays" property. Eg: { "sources":["assets/app-24b6516628ce0829b2e18e768cd8ce2b.js"] , instead of the full list of source files you'd expect.

It appears to work correctly if the fingerprint.prepend option is removed.

May be caused by one of these:

97cef3c
8279c89

Is this a known problem? I've downgraded to 4.0.1 for now.

Template literals defined outside of exports are not handled properly

After uprading to ember-cli-uglify version 2.0.0, I noticed that my production build was starting to break with this error this.__defineNonEnumerable is not a function.

After stepping through the minified & uglified code, the culprit seems to be template literals defined outside of any export object.

It don't know how to create a twiddle showing the problem, however, below is a simplified object that can successfully reproduce the bug.

import EmberObject from '@ember/object';

const TEST_PROP = `THIS WILL BREAK EMBER-CLI-UGLIFY`;

export default EmberObject.extend({
    testProp: TEST_PROP
});

ends up getting minified & uglified to

efineday("rspace/models/uglify-object-break", ["exports"], function(e) {
    Object.defineProperty(e, "__esModule", {
        value: !0
    })
    var t = Ember.Object`THIS WILL BREAK EMBER-CLI-UGLIFY`
    e.default = t.extend({
        testProp: "THIS WILL BREAK EMBER-CLI-UGLIFY"
    })
}),

As you can see, the const TEST_PROP is being replaced inside the class with the string, however, it is failing to strip template literal outside the extend.

Javascript thus thinks the line Ember.Object`THIS WILL BREAK EMBER-CLI-UGLIFY` is a tagged template literal leading to the error this.__defineNonEnumerable is not a function

Unexpected token: operator (<)

Hi, I'm getting this issue when I try to ember b -p. I'm using the latest ember 2.14.0

Build failed.
 The Broccoli Plugin: [Fingerprint] failed with:
 SyntaxError: Unexpected token: operator (<)
at JS_Parse_Error.get (eval at <anonymous> (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/uglify-js/tools/node.js:1:0), <anonymous>:86:23)
at new BroccoliBuildError (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/broccoli-builder/lib/broccoli-build-error.js:18:29)
at /Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/broccoli-builder/lib/builder.js:168:19
at tryCatch (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/rsvp/dist/rsvp.js:525:12)
at invokeCallback (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/rsvp/dist/rsvp.js:538:13)
at publish (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/rsvp/dist/rsvp.js:508:7)
at publishRejection (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/rsvp/dist/rsvp.js:443:3)
at flush (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/rsvp/dist/rsvp.js:2415:5)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)

The broccoli plugin was instantiated at:
    at Fingerprint.Plugin (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/broccoli-plugin/index.js:7:31)
at Fingerprint.Filter [as constructor] (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/broccoli-filter/index.js:34:10)
at new Fingerprint (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/broccoli-asset-rev/lib/fingerprint.js:27:10)
at Fingerprint (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/broccoli-asset-rev/lib/fingerprint.js:22:12)
at new AssetRev (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/broccoli-asset-rev/lib/asset-rev.js:27:25)
at AssetRev (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/broccoli-asset-rev/lib/asset-rev.js:7:12)
at Class.postprocessTree (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/broccoli-asset-rev/index.js:31:40)
at projectOrAddon.addons.reduce (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
at Array.reduce (native)
at addonProcessTree (/Users/ivanhueso/Documents/Panda/panda-bao-bao/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)

Sequences Break Debugger

I have some source code that looks like this:

before();
if (foo) {
  bar();
  baz();
  quux();
}
return after();

By default, Uglify will minify that into

before();
if (foo) bar(), baz(), quux();
return after();

That does save a couple characters and it is indeed functionally equivalent.

However if I open up my browser tools (with sourcemap support enabled) and set a break point on before(), I get odd behavior. The code stops where it should:

before(); // <--
if (foo) {
  bar();
  baz();
  quux();
}
return after();

When I press "step over," it goes to the if and then to bar(), as I expect:

before();
if (foo) {
  bar(); // <--
  baz();
  quux();
}
return after();

But now if I press "step over" again, it skips to after(). That's because in the actual running code, bar(), baz(), quux() is one statement!

The symptom is also described in A criticism of the Single Var Pattern in JavaScript, which suggests this same problem would occur because of join_vars.

The Workaround

In an Ember app, something like

// ember-cli-build.js:
if (app.env === 'production') {
  app.options.minifyJS.enabled = true;
  app.options.minifyJS.options = {
    compress: { sequences: 0, join_vars: false }
  };
}

will turn off sequences and join_vars.

Possible Solutions

  1. Hope the browsers fix this somehow, possibly by changing "step over" to observe comma-separated statements
  2. Have this library set the sequences compressor option to 0 by default to prevent converting ; to ,
  3. Don't change anything, but leave this issue or a wiki or docs page up describing the issue and the workaround
  4. Move this issue to ef4/broccoli-uglify-sourcemap

2.0.0-beta.1 compile times

my vendor.js seems to be taking 50 seconds on every files save when switching to the latest beta.

screen shot 2017-07-14 at 5 14 00 pm

my config/targets.js file looks like this as well:

var ENV = {
  browsers: [
    'last 1 Chrome versions',
    'last 1 Firefox versions',
    'last 1 Safari versions'
  ]
};

just thought I would bring this up incase you haven't noticed a significant slowdown.

no such file or directory, open '.../assets/dag-map.js.map'

I installed and setup for the first time.

Build Canceled: Broccoli Builder ran into an error with UglifyWriter plugin. 💥
ENOENT: no such file or directory, open '/Users/steve/projects/marais/ui/tmp/uglify_writer-input_base_path-4C6JkBvo.tmp/assets/dag-map.js.map'
Error: ENOENT: no such file or directory, open '/Users/steve/projects/marais/ui/tmp/uglify_writer-input_base_path-4C6JkBvo.tmp/assets/dag-map.js.map'

using es6-7 features appears to break this module

I get these errors:

ember build --environment=production
version: 0.2.3
Build failed.
Unexpected token operator «*», expected punc «(»
Error
    at new JS_Parse_Error (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:196:18)
    at js_error (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:204:11)
    at croak (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:684:41)
    at token_error (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:688:9)
    at expect_token (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:701:9)
    at expect (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:704:36)
    at function_ (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:964:9)
    at expr_atom (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:1193:24)
    at maybe_unary (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:1363:19)
    at expr_ops (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:1398:24)
    at maybe_conditional (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:1403:20)
    at maybe_assign (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:1427:20)
    at expression (/Users/martin.genev/Projects/how-to/client/node_modules/ember-cli-uglify/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/lib/parse.js:1446:20)

Production builds failing in ember 3.4.4 | Build Error (UglifyWriter)

Similar to #35. I'm deploying this APP to heroku using the nodejs heroku buildpack

package.json

    "ember-cli-uglify": "^2.1.0",
    "ember-cli": "~3.4.1",
    "ember-source": "3.4.4",

Error details:

ember-cli: 3.4.3
node: 8.12.0
os: linux x64

Environment: production
cleaning up...

Build Error (UglifyWriter)

Cannot read property '_walk' of null
Workaround
module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    // ...
    'ember-cli-uglify': {
      uglify: {
        compress: false // added this to workaround the issue
      }
    },
    // ...

Safari 10 /11 problem with if (!await get(something)). Exclamation point and await (async) indigestion.

I'm on latest stable of everything (Node 8.4.0, npm 5.4.1, ember-source 2.15.0, ember-cli 2.15.1).
I tried both with ember-cli-uglify v2.0.0-beta.1 and v2.0.0-beta.2.
I tried with and without mangle for damned Safari 10 (in beta.2 it is default).

I have this code:

let myPromiseContent = await get(category, "myPromise").content;
if (!myPromiseContent) {
  console.log('ByeBye Safari!');
}

myPromiseContent is a number. And I need to check if it is 0 to print that console.log().

In Safari (10 and 11, with Technology preview 39a) it blocks page rendering and says:

SyntaxError: Unexpected identifier 'a'. Expected ')' to end an 'if' condition.

The line is this one:

})), !await a(t, "myPromise").content) {

Of course if I remove await from my source code or check it like this:

if (myPromiseContent === 0) {

it works again.

But I can't use "!" with an await? Is it generally wrong? "eslint" doesn't warn me about this.

Am I wrong?

production builds failing in ember 3.0.0.beta.5: broccoliBuilderErrorStack: TypeError: name.definition is not a function

production builds started failing when I upgraded to ember 3.0.0.beta.2

ember build -e production
cleaning up...
Build failed.
Build Error (UglifyWriter)

name.definition is not a function


Stack Trace and Error Report: /var/folders/ss/sjsdtptn7j1cc6y_x8lbc3ch0000gnT/error.dump.84a92b54f2b31e423fbac3414a0600c9.log

/var/folders/ss/sjsdtptn7j1cc6y_x8lbc3ch0000gn/T/error.dump.84a92b54f2b31e423fbac3414a0600c9.log

=================================================================================

ENV Summary:

  TIME: Sat Feb 03 2018 13:15:30 GMT-0500 (EST)
  TITLE: ember
  ARGV:
  - /Users/x/.nvm/versions/node/v8.9.3/bin/node
  - /usr/local/bin/ember
  - build
  - -e
  - production
  EXEC_PATH: /Users/ron/.nvm/versions/node/v8.9.3/bin/node
  TMPDIR: /var/folders/ss/sjsdtptn7j1cc6y_x8lbc3ch0000gn/T
  SHELL: /usr/local/bin/bash
  PATH:
  - /Users/x/.pyenv/shims
  - /Users/x/.rvm/gems/ruby-head/bin
  - /Users/x/.rvm/gems/ruby-head@global/bin
  - /Users/x/.rvm/rubies/ruby-head/bin
  - /Users/x/.nvm/versions/node/lts/*/bin
  - /Users/x/.nvm/versions/node/v8.9.3/bin
  - /usr/local/bin
  - /usr/bin
  - /bin
  - /usr/sbin
  - /sbin
  - /usr/local/MacGPG2/bin
  - /Users/x/bin
  - /Applications/Xcode.app/Contents/Developer/usr/bin
  - /Users/x/.rvm/bin
  - /Users/x/.config/yarn/global/node_modules/.bin
  PLATFORM: darwin x64
  FREEMEM: 386052096
  TOTALMEM: 17179869184
  UPTIME: 231154
  LOADAVG: 3.248046875,2.896484375,2.8720703125
  CPUS:
  - Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz - 2000
  - Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz - 2000
  - Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz - 2000
  - Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz - 2000
  - Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz - 2000
  - Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz - 2000
  - Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz - 2000
  - Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz - 2000
  ENDIANNESS: LE
  VERSIONS:
  - ares: 1.10.1-DEV
  - cldr: 31.0.1
  - http_parser: 2.7.0
  - icu: 59.1
  - modules: 57
  - nghttp2: 1.25.0
  - node: 8.9.3
  - openssl: 1.0.2n
  - tz: 2017b
  - unicode: 9.0
  - uv: 1.15.0
  - v8: 6.1.534.48
  - zlib: 1.2.11

ERROR Summary:

  - broccoliBuilderErrorStack: TypeError: name.definition is not a function
    at append_var (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:11923:28)
    at flatten_vars (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:11971:21)
    at flatten_fn (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:11990:13)
    at eval (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:11792:44)
    at AST_Call.eval [as optimize] (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:7666:23)
    at Compressor.before (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:7649:24)
    at AST_Call.eval [as transform] (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4559:35)
    at eval (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4618:49)
    at Compressor.before (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:7644:9)
    at AST_Return.eval [as transform] (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4559:35)
  - codeFrame: name.definition is not a function
  - errorMessage: Build Canceled: Broccoli Builder ran into an error with `UglifyWriter` plugin. 💥
name.definition is not a function
  - errorType: Build Error
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
    - treeDir: [undefined]
  - message: Build Canceled: Broccoli Builder ran into an error with `UglifyWriter` plugin. 💥
name.definition is not a function
  - name: Error
  - nodeAnnotation: UglifyWriter
  - nodeName: UglifyWriter
  - originalErrorMessage: name.definition is not a function
  - stack: TypeError: name.definition is not a function
    at append_var (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:11923:28)
    at flatten_vars (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:11971:21)
    at flatten_fn (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:11990:13)
    at eval (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:11792:44)
    at AST_Call.eval [as optimize] (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:7666:23)
    at Compressor.before (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:7649:24)
    at AST_Call.eval [as transform] (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4559:35)
    at eval (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4618:49)
    at Compressor.before (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:7644:9)
    at AST_Return.eval [as transform] (eval at <anonymous> (/Users/x/mirai-audio/mir/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4559:35)

=================================================================================

I narrowed it down to ember-cli-uglify by disabling the addon in my ember-cli-build.js file, at which point builds would succeed.

ember-cli-build.js

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    // ...
    'ember-cli-uglify': {
      uglify: {
        compress: false // added this to workaround the issue
      }
    },
    // ...

more details:

$ember --version --verbose

ember-cli: 3.0.0-beta.2
http_parser: 2.7.0
node: 8.9.3
v8: 6.1.534.48
uv: 1.15.0
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 57
nghttp2: 1.25.0
openssl: 1.0.2n
icu: 59.1
unicode: 9.0
cldr: 31.0.1
tz: 2017b
os: darwin x6

A repo demonstrating the failure is here at this commit:
https://github.com/mirai-audio/mir/tree/7bc4b65df5d01e085c98122c8c8a79542a26dad9

Unwanted multiple passes through broccoli-uglify-sourcemap

Hi,
When I run ember build --environment=production
The files are minifying twice .Please find the below warnings,package.json,ember-cli-build.js

[WARN] (broccoli-uglify-sourcemap) Minifying: `assets/savp.js` took: 25293ms (more than 20,000ms)
[WARN] (broccoli-uglify-sourcemap) Minifying: `assets/vendor.js` took: 51400ms (more than 20,000ms)
[WARN] (broccoli-uglify-sourcemap) Minifying: `assets/savp.js` took: 34184ms (more than 20,000ms)
[WARN] (broccoli-uglify-sourcemap) Minifying: `assets/vendor.js` took: 73309ms (more than 20,000ms)

package.json

{
  "name": "savp",
  "version": "0.0.0",
  "description": "Small description for savp goes here",
  "private": true,
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "build": "ember build",
    "start": "ember server",
    "test": "ember test"
  },
  "repository": "",
  "engines": {
    "node": ">= 0.10.0"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "broccoli-asset-rev": "^2.2.0",
    "broccoli-merge-trees": "^1.1.1",
    "broccoli-static-compiler": "^0.2.2",
    "ember-bootstrap": "0.7.0",
    "ember-bootstrap-datetimepicker": "1.0.4",
    "ember-bootstrap-switch": "1.13.0",
    "ember-bootstrap-validations": "0.1.0",
    "ember-cli": "1.13.13",
    "ember-cli-app-version": "^1.0.0",
    "ember-cli-babel": "^5.1.5",
    "ember-cli-bootstrap-datepicker": "0.5.5",
    "ember-cli-content-security-policy": "0.4.0",
    "ember-cli-cors": "0.0.2",
    "ember-cli-dependency-checker": "^1.1.0",
    "ember-cli-font-awesome": "1.5.0",
    "ember-cli-google-analytics": "^1.5.0",
    "ember-cli-htmlbars": "^1.0.1",
    "ember-cli-htmlbars-inline-precompile": "^0.3.1",
    "ember-cli-ic-ajax": "0.2.4",
    "ember-cli-inject-live-reload": "^1.3.1",
    "ember-cli-less": "^1.5.3",
    "ember-cli-moment-shim": "1.2.0",
    "ember-cli-pace": "0.1.0",
    "ember-cli-pagination": "2.2.1",
    "ember-cli-qunit": "^1.0.4",
    "ember-cli-release": "0.2.8",
    "ember-cli-selectize": "0.5.3",
    "ember-cli-spinjs": "1.0.3",
    "ember-cli-sri": "^1.2.0",
    "ember-cli-toggle": "2.0.2",
    "ember-cli-uglify": "^1.2.0",
    "ember-cp-validations": "2.7.0",
    "ember-data": "1.13.15",
    "ember-data-filter": "1.13.0",
    "ember-disable-proxy-controllers": "^1.0.1",
    "ember-export-application-global": "^1.0.4",
    "ember-masonry-grid": "1.1.0",
    "ember-multiselect-checkboxes": "0.9.0",
    "ember-offline": "0.1.0",
    "ember-pikaday": "1.1.0",
    "ember-prism": "0.0.8",
    "ember-radio-button": "1.0.7",
    "ember-validations": "2.0.0-alpha.4",
    "eonasdan-bootstrap-datetimepicker": "4.15.35"
  }
}

ember-cli-build.js

/*jshint node:true*/
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var mergeTrees = require('broccoli-merge-trees');
var funnel = require('broccoli-funnel');


module.exports = function(defaults) {
  var app = new EmberApp(defaults,{
    minifyJS: {
      enabled: true
    },
    minifyCSS: {
      enabled: true
    },
	fingerprint: {
	  enabled: false
	},
	'ember-prism': {
		'components': ['groovy'],
		'plugins': ['line-highlight']
	}
  });
  app.import('bower_components/Kendo-table/js/kendo.all.js');

  app.import('bower_components/Kendo-table/styles/kendo.common-bootstrap.min.css');
  app.import('bower_components/Kendo-table/styles/kendo.bootstrap.min.css');
  app.import('bower_components/Kendo-table/styles/Bootstrap/loading-image.gif',{destDir: 'Bootstrap'});
  app.import('bower_components/Kendo-table/styles/Bootstrap/sprite.png',{destDir: 'Bootstrap'});
  app.import('bower_components/DejaVu/ttf/DejaVuSans.ttf',{destDir: 'fonts/DejaVu'});
  app.import('bower_components/DejaVu/ttf/DejaVuSans-Bold.ttf',{destDir: 'fonts/DejaVu'});  
  app.import('bower_components/jszip/dist/jszip.js');

  app.import('bower_components/jquery-extendext/jQuery.extendext.js');
  app.import('bower_components/jquery-ui/themes/smoothness/jquery-ui.css');
  app.import('bower_components/jquery-ui/jquery-ui.js');
  
  app.import('bower_components/application/application.js');
  app.import('bower_components/application/jquery.validate.js');
  app.import('bower_components/application/asidebar.jquery.js');

  app.import('bower_components/bootstrap/dist/css/bootstrap.css');
  app.import('bower_components/bootstrap/dist/js/bootstrap.js');
  var fontAwesomeIcons = funnel('bower_components/font-awesome/fonts', {
    srcDir: '/',
    destDir: 'fonts'
  });
  app.import('bower_components/mjolnic-bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css');
  app.import('bower_components/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js');
  app.import('bower_components/silviomoreto-bootstrap/dist/js/bootstrap-select.js');
  app.import('bower_components/silviomoreto-bootstrap/dist/css/bootstrap-select.css');

  app.import('bower_components/bootbox/bootbox.js');
  app.import('bower_components/jQuery-QueryBuilder/dist/css/query-builder.default.css');
  app.import('bower_components/jQuery-QueryBuilder/dist/js/query-builder.js');

  app.import('bower_components/cronjob/cronGen.js');

  app.import('bower_components/highstock-release/highstock.js');

  app.import('bower_components/dcjs/dc.css');
  app.import('bower_components/dcjs/calendar-chart.css');
  app.import('bower_components/d3/d3.js');
  app.import('bower_components/crossfilter/crossfilter.js');
  app.import('bower_components/reductio/reductio.min.js');
  app.import('bower_components/dcjs/dc.js');
  app.import('bower_components/dcjs/colorbrewer.js');

  /**Used for VIModule**/
  app.import('bower_components/lodash/lodash.js');
  app.import('bower_components/moment/moment.js');  
  app.import('bower_components/bootstrap/js/tooltip.js');
  app.import('bower_components/jqcloud2/dist/jqcloud.js');
  app.import('bower_components/select2/dist/js/select2.full.js');
  app.import('bower_components/jquery_lazyload/jquery.lazyload.js');
  app.import('bower_components/jquery-shorten/jquery.shorten.min.js');
  
  /**Used for Asset Module**/
  app.import('bower_components/architecture-tree/css/tree.css'); 
  app.import('bower_components/architecture-tree/js/d3.architectureTree.js');

  /**Used for Date picker in vi module**/
  app.import('bower_components/ion.rangeSlider/css/normalize.css');
  app.import('bower_components/ion.rangeSlider/css/ion.rangeSlider.css');
  app.import('bower_components/ion.rangeSlider/css/ion.rangeSlider.skinHTML5.css');
  app.import('bower_components/ion.rangeSlider/js/ion.rangeSlider.js');
  // Use `app.import` to add additional libraries to the generated
  // output files.
  //
  // If you need to use different assets in different
  // environments, specify an object as the first parameter. That
  // object's keys should be the environment name and the values
  // should be the asset to use in that environment.
  //
  // If the library that you are including contains AMD or ES6
  // modules that you would like to import into your application
  // please specify an object with the list of modules as keys
  // along with the exports of each module as its value.
  var merged = mergeTrees([app.toTree(), fontAwesomeIcons], {
        overwrite: true
  });

  return app.toTree(merged);
  //return app.toTree();
};

Release 2.0.0-beta.2 using broccoli-uglify-sourcemap 2.0.0-beta.2

Would you please release a 2.0.0-beta.2 version of this package, which uses broccoli-uglify-sourcemap 2.0.0-beta.2? I believe broccoli-uglify-sourcemap 2.0.0-beta.2 fixes a problem we're having, so I'd love to try it out and run some builds. Will provide feedback!

Ember cli sourcemaps setting not respected by 4.0.2?

Unlike the documentation claims, ember-cli-terser seems to generate sourcemaps even for production builds regardless of how the ember-cli sourcemaps setting is configured.

Only way to disable sourcemaps from what I can tell is explicitly set 'ember-cli-terser'.terser.sourceMap = false

Use minifyJS options hash

Do you want a PR to use the minifyJS options hash?

I think it will cause confusion if options have to be moved from the minifyJS hash to the ember-cli-uglify hash. I'd just allow the enable, exclude and uglify options to be set in either minifyJS or ember-cli-uglify (precedence), as I'm unaware of other minifyJS options that would need to be passed.

For on-boarding, documentation 1 would also need to be updated if minifyJS hash is dropped.

Not working with source mapping

With ember-cli 0.2.0, node 0.12 and ember-cli-uglify 1.0.1 I'm getting this error:

Error: Invalid mapping: {"generated":{"line":75794,"column":-50},"source":"bower_components/select2/select2.js","original":{"line":1,"column":0},"name":null}

If I remove select2 I get the same error with the next vendor package I have included so don't think it's specific to select2.

"a51329 is not defined" when running `ember s -prod`

Hi there,
I believe this might be related to the other sourcemap issues reported already, but I wanted to bring up our own issue we're running into since upgrading ember-cli-uglify to v2.0.0 from v1.2.0: When trying to visit any page in our ember app started up using ember s -prod, we get the following error in the console and nothing is rendered on-page: a51329 is not defined.

It seems like part of one of our ember addons (ember-data) got mangled after it was minified, as a few of the lines in the stack trace are functionally-different than the actual code in the addon's source code.

Run before broccoli-asset-rev.

Please add the following to package.json to ensure it runs before broccoli-asset-rev:

"ember-addon": {
  "before": "broccoli-asset-rev"
}

Issue with source maps enabled

[email protected]

I am getting an error on production build ember build --environment=production:

Build failed.
The Broccoli Plugin: [Fingerprint] failed with:
Error: ENOENT: no such file or directory, open '/Users/uni_mac/Desktop/semios/customer-web-app/tmp/uglify_writer-input_base_path-MSPzFITj.tmp/assets/popper.js.map'
    at Object.fs.openSync (fs.js:653:18)
    at Object.fs.readFileSync (fs.js:554:33)
    at UglifyWriter.processFile (/Users/uni_mac/Desktop/semios/customer-web-app/node_modules/broccoli-uglify-sourcemap/index.js:101:41)
    at /Users/uni_mac/Desktop/semios/customer-web-app/node_modules/broccoli-uglify-sourcemap/index.js:65:16
    at Array.forEach (<anonymous>:null:null)
    at /Users/uni_mac/Desktop/semios/customer-web-app/node_modules/broccoli-uglify-sourcemap/index.js:55:25
    at Array.forEach (<anonymous>:null:null)
    at UglifyWriter.build (/Users/uni_mac/Desktop/semios/customer-web-app/node_modules/broccoli-uglify-sourcemap/index.js:54:19)
    at /Users/uni_mac/Desktop/semios/customer-web-app/node_modules/broccoli-plugin/read_compat.js:93:34
    at tryCatch (/Users/uni_mac/Desktop/semios/customer-web-app/node_modules/rsvp/dist/rsvp.js:525:12)
    at invokeCallback (/Users/uni_mac/Desktop/semios/customer-web-app/node_modules/rsvp/dist/rsvp.js:538:13)
    at publish (/Users/uni_mac/Desktop/semios/customer-web-app/node_modules/rsvp/dist/rsvp.js:508:7)
    at flush (/Users/uni_mac/Desktop/semios/customer-web-app/node_modules/rsvp/dist/rsvp.js:2415:5)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

If I disable source maps build completes successfully.

Unreachable code not removed in pure functions

Reproduction https://github.com/asakusuma/build-unreachable-code

For some reason, unreachable code is removed for methods on classes, but not for pure functions. Given:

export default class TestService extends Service {
  serviceHasUnreachableCode() {
    if (!DEBUG) {
      return;
    }
    if (true) {
      return;
    }
    return;
    const num = 1;
    return num;
  } 
}

The unreachable code is removed. But given:

export function myFunction() {
  if (!DEBUG) {
    return;
  }
  if (true) {
    return;
  }
  return;
  const num = 1;
  return num;
}

We get...

e.myFunction=function(){return void 0
return void 0
return}

How to exclude source files from minification?

Hi there, my build config imports multiple files from both the vendor and bower_components directories. Some of those files are already minified and break when minified a second time.

I tried this config in order to exclude mapbox-gl.js from minification, but it does not work:

let app = new EmberApp(defaults, {
  'ember-cli-uglify': {
    exclude: ['**/mapbox-gl.js']
  }
});

// This should be minified
app.import('bower_components/my-library/library.js');

// This is already minified and breaks when minified again
app.import('vendor/mapbox-gl/mapbox-gl.js');

This configuration works:

'ember-cli-uglify': {
  enabled: false
}

So does that one:

'ember-cli-uglify': {
  exclude: ['**/vendor.js']
}

But then my vendor.js is way too big (none of the files are minified). Is it possible to exclude a source file from being minified (instead of the output file)?

Any help would be greatly appreciated!

Production builds failing without IE11 as build target

Here is a minimal reproduction: amk221/-ember-terser-failure@b8b937d

Steps to re-create:

  • Create a fresh ember-cli app
  • Include use of { ...this }
  • Remove IE11 from build targets
  • Build for prod
Build Error (TerserWriter)

Cannot read property 'references' of undefined
Full error log =================================================================================

ENV Summary:

TIME: Thu Feb 18 2021 14:32:30 GMT+0000 (Greenwich Mean Time)
TITLE: ember
ARGV:

  • /Users/andrew/.nodenv/versions/10.16.0/bin/node
  • /Users/andrew/.nodenv/versions/10.16.0/bin/ember
  • build
  • --environment=production
    EXEC_PATH: /Users/andrew/.nodenv/versions/10.16.0/bin/node
    TMPDIR: /var/folders/jr/2d1_15pj3jd2s5d5gzxwq75h0000gn/T
    SHELL: /bin/zsh
    PATH:
  • /Users/andrew/.nodenv/versions/10.16.0/bin
  • /usr/local/Cellar/nodenv/1.4.0/libexec
  • /Users/andrew/.jenv/shims
  • /Users/andrew/.nodenv/shims
  • /Users/andrew/.rbenv/shims
  • /usr/local/opt/[email protected]/bin
  • /usr/local/bin
  • /usr/bin
  • /bin
  • /usr/sbin
  • /sbin
  • /Library/Apple/usr/bin
    PLATFORM: darwin x64
    FREEMEM: 912154624
    TOTALMEM: 34359738368
    UPTIME: 621535
    LOADAVG: 11.6513671875,8.17626953125,7.015625
    CPUS:
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  • Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
    ENDIANNESS: LE
    VERSIONS:
  • ares: 1.15.0
  • brotli: 1.0.7
  • cldr: 35.1
  • http_parser: 2.8.0
  • icu: 64.2
  • modules: 64
  • napi: 4
  • nghttp2: 1.34.0
  • node: 10.16.0
  • openssl: 1.1.1b
  • tz: 2019a
  • unicode: 12.1
  • uv: 1.28.0
  • v8: 6.8.275.32-node.52
  • zlib: 1.2.11

ERROR Summary:

  • broccoliBuilderErrorStack: TypeError: Cannot read property 'references' of undefined
    at TreeTransformer.before (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:11843:51)
    at AST_Expansion.transform (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5385:41)
    at /Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5401:21
    at doit (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:112:23)
    at MAP (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:137:52)
    at do_list (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5400:12)
    at /Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5559:23
    at AST_Object.transform (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5388:13)
    at /Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5449:45
    at AST_Return.transform (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5388:13)
  • code: [undefined]
  • codeFrame: Cannot read property 'references' of undefined
  • errorMessage: Cannot read property 'references' of undefined
    at TerserWriter
    -- created here: --
    at new Plugin (/Users/andrew/src/examples/-ember-terser-failure/node_modules/broccoli-terser-sourcemap/node_modules/broccoli-plugin/dist/index.js:45:33)
    at new TerserWriter (/Users/andrew/src/examples/-ember-terser-failure/node_modules/broccoli-terser-sourcemap/index.js:30:5)
    at Class.postprocessTree (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-cli-terser/index.js:61:14)
    at projectOrAddon.addons.reduce (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
    at Array.reduce ()
    at addonProcessTree (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
    at EmberApp.addonPostprocessTree (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-cli/lib/broccoli/ember-app.js:843:12)
    at EmberApp.host.addonPostprocessTree (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-auto-import/js/auto-import.js:103:20)
    at EmberApp.toTree (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-cli/lib/broccoli/ember-app.js:1666:17)
    at module.exports (/Users/andrew/src/examples/-ember-terser-failure/ember-cli-build.js:23:14)
    -- (end) --
  • errorType: Build Error
  • location:
    • column: [undefined]
    • file: [undefined]
    • line: [undefined]
    • treeDir: [undefined]
  • message: Cannot read property 'references' of undefined
    at TerserWriter
    -- created here: --
    at new Plugin (/Users/andrew/src/examples/-ember-terser-failure/node_modules/broccoli-terser-sourcemap/node_modules/broccoli-plugin/dist/index.js:45:33)
    at new TerserWriter (/Users/andrew/src/examples/-ember-terser-failure/node_modules/broccoli-terser-sourcemap/index.js:30:5)
    at Class.postprocessTree (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-cli-terser/index.js:61:14)
    at projectOrAddon.addons.reduce (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
    at Array.reduce ()
    at addonProcessTree (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
    at EmberApp.addonPostprocessTree (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-cli/lib/broccoli/ember-app.js:843:12)
    at EmberApp.host.addonPostprocessTree (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-auto-import/js/auto-import.js:103:20)
    at EmberApp.toTree (/Users/andrew/src/examples/-ember-terser-failure/node_modules/ember-cli/lib/broccoli/ember-app.js:1666:17)
    at module.exports (/Users/andrew/src/examples/-ember-terser-failure/ember-cli-build.js:23:14)
    -- (end) --
  • name: Error
  • nodeAnnotation: [undefined]
  • nodeName: TerserWriter
  • originalErrorMessage: Cannot read property 'references' of undefined
  • stack: TypeError: Cannot read property 'references' of undefined
    at TreeTransformer.before (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:11843:51)
    at AST_Expansion.transform (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5385:41)
    at /Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5401:21
    at doit (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:112:23)
    at MAP (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:137:52)
    at do_list (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5400:12)
    at /Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5559:23
    at AST_Object.transform (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5388:13)
    at /Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5449:45
    at AST_Return.transform (/Users/andrew/src/examples/-ember-terser-failure/node_modules/terser/dist/bundle.min.js:5388:13)

=================================================================================

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.