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

ember build --env production fails when using ember-power-datepicker #8

Closed
pgengler opened this issue May 18, 2017 · 5 comments
Closed

Comments

@pgengler
Copy link

I'm not sure whether this is an ember-cli-babili problem (because all of the backtrace looks to be in there/dependencies) or with ember-power-datepicker because that's the only addon I've used so far that's had this issue, so I've reported it in both places (see cibernox/ember-power-datepicker#17 for the related issue on ember-power-select).

In short, when ember-power-datepicker is included in an app that uses ember-cli-babili and the config/targets.js file is configured to allow some native ES2015/ES2016 syntax (i.e., only targeting very modern browsers), the production build process fails.

Steps to reproduce (using ember-cli 2.13.1):

  • ember new babili-test
  • cd babili-test
  • npm uninstall --save-dev ember-cli-uglify
  • ember install ember-cli-babili
  • Edit config/targets.js to remove ie 9 (at this point, running ember build --env production will succeed)
  • ember install ember-power-datepicker
  • ember build --env production

The build fails with this error:

Build failed.
The Broccoli Plugin: [BabiliPlugin] failed with:
TypeError: assets/vendor.js: Cannot read property 'scope' of null
    at /Users/pgengler/tmp/babili-test/node_modules/babel-plugin-minify-simplify/lib/index.js:1504:42
    at Array.every (native)
    at genericEarlyExitTransform (/Users/pgengler/tmp/babili-test/node_modules/babel-plugin-minify-simplify/lib/index.js:1473:29)
    at earlyReturnTransform (/Users/pgengler/tmp/babili-test/node_modules/babel-plugin-minify-simplify/lib/index.js:1437:9)
    at PluginPass.exit (/Users/pgengler/tmp/babili-test/node_modules/babel-plugin-minify-simplify/lib/index.js:528:11)
    at newFn (/Users/pgengler/tmp/babili-test/node_modules/babel-traverse/lib/visitors.js:276:21)
    at NodePath._call (/Users/pgengler/tmp/babili-test/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/Users/pgengler/tmp/babili-test/node_modules/babel-traverse/lib/path/context.js:48:17)
    at NodePath.visit (/Users/pgengler/tmp/babili-test/node_modules/babel-traverse/lib/path/context.js:117:8)
    at TraversalContext.visitQueue (/Users/pgengler/tmp/babili-test/node_modules/babel-traverse/lib/context.js:150:16)

The broccoli plugin was instantiated at:
    at BabiliPlugin.Plugin (/Users/pgengler/tmp/babili-test/node_modules/broccoli-plugin/index.js:7:31)
    at BabiliPlugin (/Users/pgengler/tmp/babili-test/node_modules/broccoli-babili/lib/babili-plugin.js:12:5)
    at Class.postprocessTree (/Users/pgengler/tmp/babili-test/node_modules/ember-cli-babili/lib/index.js:25:14)
    at projectOrAddon.addons.reduce (/Users/pgengler/tmp/babili-test/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
    at Array.reduce (native)
    at addonProcessTree (/Users/pgengler/tmp/babili-test/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
    at EmberApp.addonPostprocessTree (/Users/pgengler/tmp/babili-test/node_modules/ember-cli/lib/broccoli/ember-app.js:586:12)
    at EmberApp.toTree (/Users/pgengler/tmp/babili-test/node_modules/ember-cli/lib/broccoli/ember-app.js:1691:17)
    at module.exports (/Users/pgengler/tmp/babili-test/ember-cli-build.js:22:14)
    at Builder.setupBroccoliBuilder (/Users/pgengler/tmp/babili-test/node_modules/ember-cli/lib/models/builder.js:56:19)

If you then revert config/targets.js (so that 'ie 9' is listed again) the build succeeds.

@pgengler
Copy link
Author

pgengler commented May 22, 2017

FYI this also happens when installing ember-basic-dropdown instead of ember-power-datepicker (which brings in ember-basic-dropdown as a dependency). Just in case that helps narrow things at all.

@bmeurant
Copy link

Hi,

seems related to this issue babel/minify/pull/517. I made a quick test and it seems that bumping babel-preset-babili version from 0.0.12 to 0.1.1 in https://github.com/ember-cli/broccoli-babili fixes it.

@scottkidder
Copy link

I am seeing this as well (using ember-power-select which also depends on ember-basic-dropdown)

@rwjblue
Copy link
Member

rwjblue commented Jun 15, 2017

Can you test with the latest version? Many bugs have been fixed in 0.2.0's underlying babili version...

@pgengler
Copy link
Author

Confirmed that this is fixed with 0.2.0. Thanks!

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

No branches or pull requests

4 participants