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

Error since release of babel-preset-babili 0.1.3 #583

Closed
mistic opened this issue Jun 15, 2017 · 6 comments
Closed

Error since release of babel-preset-babili 0.1.3 #583

mistic opened this issue Jun 15, 2017 · 6 comments

Comments

@mistic
Copy link

mistic commented Jun 15, 2017

Hi guys

I'm using babili-webpack-plugin but since you release the version babel-preset-babili@0.1.3 2 days ago I have my production build with errors after minifying my javascript code. I haven't been able to identify the dependency with bug (so I dont know if it is related with this #577) however reverting babili to version 0.0.11 (which also reverts all the other babili packages for sure like babel-plugin-minify-constant-folding) everything starts working again.

This are the errors I have (I'm trying to link the source maps to identify the code before it was minified):

Uncaught (in promise) TypeError: Cannot read property 'location' of undefined

function Router() {
    var _temp, _this, _ret;

    _classCallCheck(this, Router);

    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
      match: _this.computeMatch(_this.props.history.location.pathname)
    }, _temp), _possibleConstructorReturn(_this, _ret);
  }

This code is from react-router.

@mistic mistic changed the title Error since babel-preset-babili 0.1.3 Error since release of babel-preset-babili 0.1.3 Jun 15, 2017
@mistic
Copy link
Author

mistic commented Jun 15, 2017

Guys it's confirmed..
With those versions everything work:

"babel-preset-babili": "0.1.2",

    "babel-plugin-minify-constant-folding": "0.1.1",
    "babel-plugin-minify-builtins": "0.1.1",
    "babel-plugin-minify-dead-code-elimination": "0.1.6",
    "babel-plugin-minify-flip-comparisons": "0.1.1",
    "babel-plugin-minify-guarded-expressions": "0.1.1",
    "babel-plugin-minify-infinity": "0.1.1",
    "babel-plugin-minify-mangle-names": "0.1.2",
    "babel-plugin-minify-numeric-literals": "0.1.1",
    "babel-plugin-minify-replace": "0.1.1",
    "babel-plugin-minify-simplify": "0.1.1",
    "babel-plugin-minify-type-constructors":"0.1.1",
    "babel-plugin-transform-inline-consecutive-adds":"0.1.1",
    "babel-plugin-transform-member-expression-literals":"6.8.3",
    "babel-plugin-transform-merge-sibling-variables":"6.8.4",
    "babel-plugin-transform-minify-booleans":"6.8.2",
    "babel-plugin-transform-property-literals":"6.8.3",
    "babel-plugin-transform-regexp-constructors":"0.1.1",
    "babel-plugin-transform-remove-console":"6.8.3",
    "babel-plugin-transform-remove-debugger":"6.8.3",
    "babel-plugin-transform-remove-undefined":"0.1.1",
    "babel-plugin-transform-simplify-comparison-operators":"6.8.3",
    "babel-plugin-transform-undefined-to-void":"6.8.2",

changing from babel-plugin-minify-constant-folding@0.0.1 to babel-plugin-minify-constant-folding@0.1.2 the build stop working again.

@boopathi
Copy link
Member

boopathi commented Jun 15, 2017

I'm not sure what the bug is from the details your provided. Can you give me more details - like stack trace or minimal reproduction of the issue ?

@mistic
Copy link
Author

mistic commented Jun 15, 2017

@boopathi I can post the full stack trace of this particular issue I post but the code are the one I post above. As this is related with babel-plugin-minify-constant-folding and the code I post have an Array.concat do u believe that this issue is also related with the already reported code?

@jfurfaro
Copy link

jfurfaro commented Jun 15, 2017

I'm getting the same error, but it only occurs if the JS was compiled in my docker build. I tried fresh npm install's on my mac, and everything compiled just fine. The minified file inside the docker image is actually different than my mac as well. Can't pinpoint the difference between environments

UPDATE: Got node on my Mac and Docker matched at 8.1.2, and now both environments have the same error described.

@dirtybit
Copy link
Contributor

I think this is because of #577. Fixed in #578.

@boopathi
Copy link
Member

As mentioned, Array.prototype.concat is fixed in #578. Will do a release soon.

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