Closed
Description
I upgraded from RN 15 to RN 16 and now I get:
babelHelpers.objectDestructuringEmpty is not a function
:
Currently my .babelrc
files looks like:
{
"presets": ["react"],
"plugins": [
"transform-decorators-legacy",
"transform-es2015-classes",
"transform-export-extensions"
]
}
I previously also had es2015
in the presets
list but then I got: http://stackoverflow.com/questions/34112110/upgrade-to-react-native-0-16-error.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
facebook-github-bot commentedon Dec 16, 2015
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.
react-native
or for more real time interactions, ask on Discord in the #react-native channel.udfalkso commentedon Dec 21, 2015
Hi @cancan101 I'm also hitting this issue. Did you manage to solve it? Thanks
cancan101 commentedon Dec 21, 2015
Try adding
"transform-runtime"
to the plugins.udfalkso commentedon Dec 21, 2015
Thanks. Did you have to add babel-runtim@6.x 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.
udfalkso commentedon Dec 21, 2015
@cancan101 Any chance you could share what's in your package.json and .babelrc files? Would be very helpful, thanks!
udfalkso commentedon Dec 22, 2015
Finally managed to get past this error. It turns out that I had code like this that needed to be removed:
cancan101 commentedon Dec 22, 2015
That worked for me as well.
cancan101 commentedon Dec 22, 2015
Is this some sort of know issue ? How did you figure it out.
udfalkso commentedon Dec 22, 2015
Just a lot of digging around and trial and error.
satya164 commentedon Dec 22, 2015
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
.babelrc
and add what you need.udfalkso commentedon Dec 22, 2015
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.
satya164 commentedon Dec 22, 2015
@udfalkso Yeah, in your case yes. But the packager uses your
.babelrc
instead if you have one, or at least that's how it used to be. I haven't tried with a custom.babelrc
in the latest version though.cancan101 commentedon Dec 23, 2015
Right now I am using a
.babelrc
of:and it works as long as I remove all instances of:
udfalkso commentedon Dec 23, 2015
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.
21 remaining items