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

SyntaxError after transform-remove-console #374

Closed
DrewML opened this issue Jan 14, 2017 · 1 comment
Closed

SyntaxError after transform-remove-console #374

DrewML opened this issue Jan 14, 2017 · 1 comment

Comments

@DrewML
Copy link
Member

DrewML commented Jan 14, 2017

Original bug report from @brunolemos in babel/babel#5106

Input Code

https://github.com/jayphelps/core-decorators.js/blob/master/src/time.js#L7

var defaultConsole = {
  time: console.time ? console.time.bind(console) : function (label) {
    labels[label] = new Date();
  },
};

Babel Configuration (.babelrc, package.json, cli command)

{
  "presets": [
    "react-native",
    "react-native-stage-0/decorator-support"
  ],
  "plugins": [
    "transform-es2015-parameters",
    "transform-remove-console"
  ]
}

Expected Behavior

Remove console.* without breaking the code

Current Behavior

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1740):
SyntaxError: TransformError: /node_modules/core-decorators/lib/time.js: /node_modules/core-decorators/lib/time.js:
Property consequent of ConditionalExpression expected node to be of a type ["Expression"] but instead got null
(node:47674) DeprecationWarning: Unhandled promise rejections are deprecated. 
In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Context

Added transform-remove-console on a React Native application, but it crashes.

Your Environment

software version
Babel 6.18
node 7.3.0
npm 4.0.5
React Native 0.39.2
Operating System macOS 10.12.3
@danez
Copy link
Member

danez commented Jan 14, 2017

Duplicate of #300

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

2 participants