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 #5106

Closed
brunolemos opened this issue Jan 14, 2017 · 3 comments
Closed

SyntaxError after transform-remove-console #5106

brunolemos opened this issue Jan 14, 2017 · 3 comments
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@brunolemos
Copy link

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
@babel-bot
Copy link
Collaborator

Hey @brunolemos! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@DrewML
Copy link
Member

DrewML commented Jan 14, 2017

Moved to babel/minify#374

@DrewML DrewML closed this as completed Jan 14, 2017
@danez
Copy link
Member

danez commented Jan 14, 2017

Also reported in babel/minify#300

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 5, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

5 participants