Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
0xadada opened this issue Feb 3, 2018 · 2 comments
Labels

Comments

@0xadada
Copy link

0xadada commented Feb 3, 2018

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

0xadada added a commit to mirai-audio/mir that referenced this issue Feb 3, 2018
* [x] Related to ember-cli/ember-cli-terser#35 */
* [x] Added build for production to CircleCI
@0xadada
Copy link
Author

0xadada commented Feb 3, 2018

possibly related mishoo/UglifyJS#2647

0xadada added a commit to mirai-audio/mir that referenced this issue Feb 3, 2018
0xadada added a commit to mirai-audio/mir that referenced this issue Feb 6, 2018
0xadada added a commit to mirai-audio/mir that referenced this issue Feb 6, 2018
@snewcomer
Copy link

Note: I am having the same issues with terser. Fixing to 3.7.5 solves the issue. Still digging into the exact reason why.

broccoliBuilderErrorStack: TypeError: argname.definition is not a function

node_modules/terser/tools/node.js:21:1), <anonymous>:10835:31)

https://github.com/fabiosantoscode/terser/commits/master

ember && ember-cli @ 3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants