-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
babelHelpers.objectDestructuringEmpty is not a function #4831
Comments
Hey cancan101, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
Hi @cancan101 I'm also hitting this issue. Did you manage to solve it? Thanks |
Try adding |
Thanks. Did you have to add [email protected] to your package file to get this to work? (See: https://phabricator.babeljs.io/T2759) I've tried that and now I get this problem:
But this file is there.
|
@cancan101 Any chance you could share what's in your package.json and .babelrc files? Would be very helpful, thanks! |
Finally managed to get past this error. It turns out that I had code like this that needed to be removed:
|
That worked for me as well. |
Is this some sort of know issue ? How did you figure it out. |
Just a lot of digging around and trial and error. |
You seem to be using very few transforms, and missing lots of transforms like destructuring, which might be causing the issue. It'll be better to copy/extend React Native's |
Aren't those transforms automatically being run by the RN packager @satya164 ? This was a special case of destructuring an empty object which I think caused the problem here. |
@udfalkso Yeah, in your case yes. But the packager uses your |
Right now I am using a {
"presets": [],
"plugins": [
"transform-decorators-legacy",
"transform-export-extensions"
]
} and it works as long as I remove all instances of: const {
} = React; |
I'm using an empty .babelrc file, but using es6 modules and other things. So I assume RN packager is picking up the rest of the slack. Finally all working now. |
Is this an issue with Babel 6? A feature? |
2 days ago we decided to upgrade RN from 0.14 to 0.19, after trial and errors we reached the Not sure if it's a feature but it was working fine in Babel 5. Most likely Babel 6 is stricter. |
can someone further explain the solution to this error? |
I had a similar issue because I used |
I found this issue when having braces in place for destructuring, but without any values between the braces. e.g. I believe Babel is simply complaining that the object is in fact empty, and does not have any values to destructure. |
For me adding extra curly bracket causing this issue. so I have changed |
I too fell down this trap! Yes, you may use an empty object {}, but are you sure you aren't having a syntax error like: let { } = this.props; That's what got me! |
Hi Guys, I am also experiencing this error when I Run and Build my react native app on XCode. [error][tid:com.facebook.react.JavaScript] babelHelpers.objectDestructuringEmpty is not a function. (In 'babelHelpers.objectDestructuringEmpty(o.default)', 'babelHelpers.objectDestructuringEmpty' is undefined) I already tried all the solutions here but still facing the problem. |
i had this issue also, the reason was |
|
It's a shame that the only fix here is "don't do that." Empty destructuring is perfectly valid, and it could be a nice idiom for ignoring an argument, as in |
I got this fix upon installing babel helper plugin. Package.json: babelrc: Reference to install this plugin: |
My issue was an empty destructuring for the arguments of a function. What's interesting is this was only an issue when I did a production build. In my iOS emulator I didn't get an exception. |
@vigneshprabhu20 I just tried your solution and sadly I still have the same problem. I fixed my problem thanks to your comments.
and it should be like this :
A fix is really needed for this 👍 |
tks @vigneshprabhu20 you solution worked for me |
I upgraded from RN 15 to RN 16 and now I get:

babelHelpers.objectDestructuringEmpty is not a function
:Currently my
.babelrc
files looks like:I previously also had
es2015
in thepresets
list but then I got: http://stackoverflow.com/questions/34112110/upgrade-to-react-native-0-16-error.The text was updated successfully, but these errors were encountered: