Babel: undefined is not a function(evaluation 'object.getOwnPropertyDescriptors(arguments[i])')

Created on 5 Jul 2019  路  91Comments  路  Source: babel/babel

https://github.com/facebook/react-native/issues/23092

Unfortunately this exact same issue strikes again with the release of Babel v7.5.0.

These are the Babel related dependencies I am having:

    "@babel/core": "7.4.5",
    "@babel/plugin-proposal-class-properties": "7.4.4",
    "@babel/plugin-proposal-decorators": "7.4.4",
    "@babel/plugin-transform-flow-strip-types": "7.4.4",
    "@babel/preset-flow": "7.0.0",
    "babel-eslint": "10.0.2",
    "babel-jest": "24.8.0",
    "metro-react-native-babel-preset": "0.54.1",

With the package-lock.json I generated a few days ago everything's fine with npm install, but if I try to do it without the lockfile the error appears. Judging from my lockfile's diff I can say that a few secondary Babel dependencies were updated to v7.5.0 without the lockfile (eg. @babel/generator, @babel/helper-create-class-features-plugin) so am pretty sure this is a Babel issue again.

Has PR High bug regression outdated

Most helpful comment

Published as 7.5.4!
I have also published @babel/core (even if it didn't contain any change), so that you can update it to be sure that @babel/helpers is ^7.5.4

All 91 comments

Hey @gsklee! 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.

I'm confirming the issue is on Babel side, I have the same issue.

To reproduce with an example you can do the following :

git clone https://github.com/open-xml-templating/docxtemplater.git
cd docxtemplater
git checkout fa3d9fed040befaa7d2da7402e0cfbe042564bd4
npm install
# n use 6 (use node 6 which does not have object.getOwnPropertyDescriptors for example)
npm test
# You will have many tests that fail with this error message

I am pretty sure this is the plugin-proposal object-rest-spread since the generated code is as follows :

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { if (i % 2) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } else { Object.defineProperties(target, Object.getOwnPropertyDescriptors(arguments[i])); } } return target; }

This was probably introduced here : https://github.com/babel/babel/pull/9384

Same issue

Same issue

Same issue.

We're also having a hard time because of this as well.

resolve.modules: ["node_modules", "web_modules"]

web_modules not work for @bable/core version v7.5.0, import any module from web_modules to invoke will be undefined.

Fixed locking @babel/plugin-proposal-object-rest-spread to 7.4.4in package.json

@gorkalaucirica Can you please share your entire package.json here ?

image

I have the same issue.

issue same here in combination with IE11

Is just a missing core js polyfill that needs to be added to babel runtime: import 'core-js/modules/es6.object.get-own-property-descriptor.js';

A hotfix would be to add the following to your polyfill.js, note that it is different to *get-own-property-descriptor.

import 'core-js/modules/es6.object.get-own-property-descriptors';

Object.getOwnPropertyDescriptors is not supported on Node.js until 7.0.0. As Babel 7 works on Node >= 6.9.0, ideally babel-preset-env should take care of this. I am investigating this issue and hopefully I will work on a fix later.

Note that Babel works in node >=6, but it's output should work in older engines

Is a missing polyfill somewhere in babel runtime.

Still I get issue.

my _package.json_ looks like :

"devDependencies": {
    "@babel/core": "7.5.0",
    "@babel/preset-react": "7.0.0",
    "@babel/runtime": "7.5.1",
    "babel-core": "6.26.3",
    "babel-eslint": "10.0.2",
    "babel-jest": "24.8.0",
    "babel-plugin-ignite-ignore-reactotron": "0.3.0",
    "babel-plugin-transform-inline-environment-variables": "0.4.3",
    "babel-preset-env": "1.7.0",
    "babel-preset-react-native": "4.0.1",
   .....

Using react-native v0.57.7

Please fix this issue. Very annoying. Cant fix :(

Still I get issue.

my _package.json_ looks like :

"devDependencies": {
    "@babel/core": "7.5.0",
    "@babel/preset-react": "7.0.0",
    "@babel/runtime": "7.5.1",
    "babel-core": "6.26.3",
    "babel-eslint": "10.0.2",
    "babel-jest": "24.8.0",
    "babel-plugin-ignite-ignore-reactotron": "0.3.0",
    "babel-plugin-transform-inline-environment-variables": "0.4.3",
    "babel-preset-env": "1.7.0",
    "babel-preset-react-native": "4.0.1",
   .....

Using react-native v0.57.7

Have you tried to update to 7.5.1?

Still I get issue.
my _package.json_ looks like :

"devDependencies": {
    "@babel/core": "7.5.0",
    "@babel/preset-react": "7.0.0",
    "@babel/runtime": "7.5.1",
    "babel-core": "6.26.3",
    "babel-eslint": "10.0.2",
    "babel-jest": "24.8.0",
    "babel-plugin-ignite-ignore-reactotron": "0.3.0",
    "babel-plugin-transform-inline-environment-variables": "0.4.3",
    "babel-preset-env": "1.7.0",
    "babel-preset-react-native": "4.0.1",
   .....

Using react-native v0.57.7

Have you tried to update to 7.5.1?

"@babel/helpers" : "7.5.1",
"@babel/plugin-proposal-object-rest-spread" : "7.5.1",
"@babel/plugin-transform-typescript": "7.5.1"

still the same issue

@seifsay3d Indeed, I use latest releases about my babel dependencies as you can see in my package.json.

I personally have not checked yet if issue is fixed, but if you still have the issue, did you rm -rf node_modules before installing?

@LucaMele for sure, I'v deleted node_modules with the package-lock.json in addition ! I've also upgraded all packages but I get same result..

Facing same issue here. I have also downgraded babel-core to lower version (6.26.3) but due to some third party libraries using @babel/core internally, package-lock.json still contains
@bable/core: 7.5.0.
It looks like this:
"@babel/core": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.5.0.tgz", "requires": { "@babel/code-frame": "^7.0.0", "@babel/generator": "^7.5.0", "@babel/helpers": "^7.5.0", "@babel/parser": "^7.5.0", "@babel/template": "^7.4.4", "@babel/traverse": "^7.5.0", "@babel/types": "^7.5.0", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", "lodash": "^4.17.11", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" }, "dependencies": { "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "requires": { "ms": "^2.1.1" } }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", } } },

Please wait until 7.5.2 is released (there is till a pending PR, I hope to get it finished today).

Is my Bug also related to this?
@nicolo-ribaudo when will 7.5.2 be released and when will @babel/runtime adapt the changes

Yeah it looks the same bug.
I will release it as soon as #10174 is resolved.

Anything to do before fix done?

@guidorubin
Forcing resolution of @babel/plugin-proposal-object-rest-spread to 7.4.4 worked for us as suggested by @gorkalaucirica https://github.com/babel/babel/issues/10166#issuecomment-508732941
We are using yarn so we were able to use the selective dependency resolutions feature by adding the following to our package.json

"resolutions": {
  "@babel/plugin-proposal-object-rest-spread": "7.4.4"
}

Thanks @belemaire! I'm still getting the same error ... :sweat:

Are you using yarn as well ?
Did you run yarn install after adding the resolutions field to your package.json ?

Yep, using Yarn! And I did all the steps...

Hmm 馃檮
Running yarn why @babel/plugin-proposal-object-rest-spread
Should then only list one resolved version

Found "@babel/[email protected]"

If it does, then the issue you are facing could not been the one identified here or other reason due to your setup. Also if you are using react-native you should make sure to start the packager with --reset-cache option.

7.5.2 released!
Please check that in your lockfile @babel/helpers and/or @babel/runtime are v7.5.2 :slightly_smiling_face:

I will test it in a moment 馃槍

Thanks for the help @nicolo-ribaudo! I have @babel/helpers and @babel/runtime both as v7.5.2 in my lockfile, but now I'm getting the error "Property description must be an object." Any help is much appreciated.

Thanks for the help @nicolo-ribaudo! I have @babel/helpers and @babel/runtime both as v7.5.2 in my lockfile, but now I'm getting the error "Property description must be an object." Any help is much appreciated.

Same result for me :

Capture d鈥檈虂cran 2019-07-08 a虁 23 21 44

EDIT : my package-lock.json contains "@babel/runtime" v7.5.2

If you move this line before the if statement in @babel/runtime/helpers/objectSpread2.js and @babel/runtime/helpers/esm/objectSpread2.js, does it work?

Ohhhhh I managed to reproduce it using node 4. It's my fault, I'm sorry :sweat_smile:

If you move this line before the if statement in @babel/runtime/helpers/objectSpread2.js and @babel/runtime/helpers/esm/objectSpread2.js, does it work?

No, same result @nicolo-ribaudo..

Ohhhhh I managed to reproduce it using node 4. It's my fault, I'm sorry 馃槄

Oh ! 馃槄 No problem, thank you for your hard work ! as soon as possible ? :D

While waiting for a fix, we've configure object-rest-spread to use loose option.

            plugins: [
                    ...,
                    ['@babel/plugin-proposal-object-rest-spread', {
                        loose: true
                    }],
                    ...
            ]

@guidorubin
Forcing resolution of @babel/plugin-proposal-object-rest-spread to 7.4.4 worked for us as suggested by @gorkalaucirica #10166 (comment)
We are using yarn so we were able to use the selective dependency resolutions feature by adding the following to our package.json

"resolutions": {
  "@babel/plugin-proposal-object-rest-spread": "7.4.4"
}

work for me

I am also facing the same issue as @JordanProtin after updating to v7.5.2.

We got this error:

com.facebook.react.common.JavascriptException 路 undefined is not a function (evaluating 'Object.getOwnPropertyDescriptors(arguments[n])'), stack: <unknown>@64:476 <unknown>@64:502 _@2:1514 d@2:967 o@2:435 <unknown>@63:67 _@2:1514 d@2:967 o@2:435 <unknown>@59:483 _@2:1514 d@2:967 o@2:435 <unknown>@292:148 _@2:1514 d@2:967 o@2:435 <unknown>@330:59 _@2:1514 d@2:967 o@2:435 <unknown>@326:545 _@2:1514 d@2:967 o@2:435 AppRegistry@12:2496 <unknown>@11:42 _@2:1514 d@2:897 o@2:435 global code@1547:4

Stacktrace:

ExceptionsManagerModule.java:54com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError 
ExceptionsManagerModule.java:38com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException 
Method.java:-2java.lang.reflect.Method.invoke   
JavaMethodWrapper.java:372com.facebook.react.bridge.JavaMethodWrapper.invoke    
JavaModuleWrapper.java:158com.facebook.react.bridge.JavaModuleWrapper.invoke    
NativeRunnable.java:-2com.facebook.react.bridge.queue.NativeRunnable.run    
Handler.java:754android.os.Handler.handleCallback   
Handler.java:95android.os.Handler.dispatchMessage   
MessageQueueThreadHandler.java:29com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage  
Looper.java:163android.os.Looper.loop   
MessageQueueThreadImpl.java:192com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run 
Thread.java:760java.lang.Thread.run

https://github.com/zys-contribs/babel/pull/108/commits/25f040caa45265c40bbefb7f09b8aee0a2dbfd2c
^

By looking at the second point, it should be fixed in 7.5.2
"@babel/plugin-proposal-object-rest-spread": "7.5.2"

While waiting for a fix, we've configure object-rest-spread to use loose option.

            plugins: [
                    ...,
                    ['@babel/plugin-proposal-object-rest-spread', {
                        loose: true
                    }],
                    ...
            ]

Indeed, this works fine ! It's a good temporary solution ! Thank you @nasvillanueva

I have this issue with @babel/helpers and @babel/runtime in v7.5.2
error_apk

@nicolo-ribaudo This problem has plagued me for a few days, I hope to solve it as soon as possible, thank you!

7.5.2 released!
Please check that in your lockfile @babel/helpers and/or @babel/runtime are v7.5.2 馃檪

In case you struggle with getting this to work: I removed my yarn.lock file completely, ran yarn install again and let it re-create from scratch - after that everything worked again!

I have just released v7.5.3, which should fix the Property descriptor must be an object error. The undefined is not a function error has been fixed in v7.5.2.

Please check in your lockfile that all these packages have been updated:

 - @babel/helpers => 7.5.3
 - @babel/plugin-proposal-object-rest-spread => 7.5.3
 - @babel/preset-env-standalone => 7.5.3
 - @babel/preset-env => 7.5.3
 - @babel/runtime-corejs2 => 7.5.3
 - @babel/runtime-corejs3 => 7.5.3
 - @babel/runtime => 7.5.3
 - @babel/standalone => 7.5.3

If you are using yarn, you can run yarn upgrade -s @babel to update them.

If it still doesn't work, please update your lockfile in a gist and share it.

Thank you very much

Also, if someone could confirm that it works it would be much appreciated :blush:

@nicolo-ribaudo
Thanks much.
Just tried it with our app.
Validated from yarn.lock that it was using 7.5.3 for all the packages you updated. The original error undefined is not a function(evaluation 'object.getOwnPropertyDescriptors(arguments[i])') went away, however we now get the same error mentioned in this comment https://github.com/babel/babel/issues/10166#issuecomment-509397077
Had to force back resolution of @babel/plugin-proposal-object-rest-spread to 7.4.4 again :(
Is that a different issue that is being addressed in a different PR not yet merged, or is it something that should have been fixed in 7.5.3 as well ?

Hi @nicolo-ribaudo, I'm still getting the error :(
image
My package.json is

"dependencies": {
"babel-core": "^6.26.3",
"prop-types": "^15.6.2",
"react": "16.6.3",
"react-native": "0.57.8",
"react-native-gesture-handler": "^1.0.12",
"react-navigation": "^3.0.9"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}

any idea? Thanks in advance!

@belemaire 7.5.3 should have fixed that new error, while the old error should have been fixed by v7.5.2. Can you share your lockfile?

@guidorubin You are using Babel 6, not Babel 7. Can you share your lockfile?

Sure!
yarn.txt

Ok @guidorubin, it looks correct. I need your help :slightly_smiling_face:

That function is only used once in Babel's helpers, by the function _objectSpread helper:
https://github.com/babel/babel/blob/b961d39a4d77a48cf984dd1b35573d6187c71728/packages/babel-helpers/src/helpers.js#L430-L432

As you can see, we check that it is defined before calling it. Could you put there a breakpoint and check how it is possible that it goes into that if even if Object.getOwnPropertyDescriptors is undefined?

Also, if React Native has some sort of cache, please clear it.

Hey @nicolo-ribaudo, I'm now getting the below error after updating my lockfile to have all the 7.5.3 versions. I reset my cache and everything too.

Screen Shot 2019-07-09 at 12 22 26 PM

WhatsApp Image 2019-07-09 at 18 27 16

I got this error.
I assured all the versions in my package-lock.json match the ones from here:

I have just released v7.5.3, which should fix the Property descriptor must be an object error. The undefined is not a function error has been fixed in v7.5.2.

Please check in your lockfile that all these packages have been updated:

 - @babel/helpers => 7.5.3
 - @babel/plugin-proposal-object-rest-spread => 7.5.3
 - @babel/preset-env-standalone => 7.5.3
 - @babel/preset-env => 7.5.3
 - @babel/runtime-corejs2 => 7.5.3
 - @babel/runtime-corejs3 => 7.5.3
 - @babel/runtime => 7.5.3
 - @babel/standalone => 7.5.3

If you are using yarn, you can run yarn upgrade -s @babel to update them.

If it still doesn't work, please update your lockfile in a gist and share it.

@pwnreza pretty sure if you clear cache and kill your node server to fully start again you'll end up at the updated error I got above.

@nicolo-ribaudo Here is our lock file https://gist.github.com/belemaire/4be1179a6e51c0e3ecab9f566f52087c
Getting property description must be an object error

@maxmodel What is the code generated by Babel which calls _objectSpread?
@pwnreza Can you put a breakpoint there and check what does Object.getOwnPropertyDescriptor(arguments[i], key) return?

@nicolo-ribaudo sorry if this is a silly question but where/how can I find that?

Pretty sure the error references the same bit of code in helpers.js (line 431) that you referenced earlier, only now it's not recognizing arguments[i] as an object when attempting to get its property descriptor.

I don't know how React Native works (I have never used it), but I'm sure there is a way somehow to get the source code which is sent to the app.

Could you put a breakpoint and check what arguments is?

Ok I'm trying to repro this now, I think I got it (don't need react native to check since it's clear the error message)

EDIT:

Thanks for the comments everyone! Would of been a bit easier to clone a repro case/repo but in this case it was possible to figure out with some sleuthing.

Thinking process:

undefined is not a function(evaluation 'object.getOwnPropertyDescriptors(arguments[i])')

Our favorite error message. Just says that the function isn't there. Makes sense since we established that certain environments may not support that function.

This is why there was the if statement added here (and why a workaround would be to simply add the polyfill for it, or to use loose mode):

else if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(arguments[i]));

@babel/helpers files

Located at https://github.com/babel/babel/blob/master/packages/babel-helpers/src/helpers.js#L388-L444

property description must be an object

arguments[i] is something other than an object.

I just reproduced by installing from scratch, and adding a simple piece of code to test object spread: var a = {...{}, b: 2 };

To throw the error I just removed support instead of installing an old version of Node: Object.getOwnPropertyDescriptors = undefined;

Via https://github.com/babel/babel/pull/10180, arguments is different in different functions

Object.getOwnPropertyDescriptors = undefined;
var a = {...{}, b: 2 };
"use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { if (i % 2) { var source = arguments[i] != null ? arguments[i] : {}; ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(arguments[i])); } else { ownKeys(arguments[i]).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(arguments[i], key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

Object.getOwnPropertyDescriptors = undefined;

var a = _objectSpread({}, {}, {
  b: 2
});

We have a solution!

Please confirm that ##10188 works by changing @babel/helpers in your node_modules like I did in that PR!

Just did same code modifications locally as you did in @babel/helpers and it works fine now :+1:
Thanks much @nicolo-ribaudo @hzoo

Wohoooo :heart:

Great we can make a release very soon then! Thanks for all your patience everyone! We are all learning here (and also I believe Nicol貌 is studying for exams even).

I think we can do a writeup on some of the issues we've encountered here later as well, and hopefully that's useful to everyone.

  • ES6+ code actually helps fix bugs (...spread instead of arguments)
  • We currently don't use ES6+ in Babel's helpers because we need the helpers themselves to be transpilable (hopefully soon: related to my post but we ideally want ES6+ source in your own app code, your dependencies, and babel's own helpers too)
  • Versioning is hard

All good for us, as we had a proper workaround while waiting for a proper fix.
Thanks again for the quick support and your awesome work on Babel.
Looking forward to the new release !
And wish you well for your exams @nicolo-ribaudo ;)

Published as 7.5.4!
I have also published @babel/core (even if it didn't contain any change), so that you can update it to be sure that @babel/helpers is ^7.5.4

thank you @nicolo-ribaudo

It's working for us

@nicolo-ribaudo
We still have a problem and I don't know if it is related to this fix.
There is an often reoccurring pattern in our code regarding redux:

import React, { Component } from 'react';
import { connect } from 'react-redux';
import { someAction } from '../../store/data/actions';

class SomeComponent extends Component {
  componentWillMount() {
    const { someAction } = this.props;
    someAction();
  }

  render() {
    return null;
  }
}

export default connect(null, {
  someAction,
})(SomeComponent);

When I try to "overload" the 'someAction' variable I get an runtime error which I can inspect via logcat (android logs used on my react-native app) looking something like this:

Possible Unhandled Promise Rejection (id: 1): Error: "someAction" is read-only.

If I don't "overload" the variable and instead try to do something like this
componentWillMount() { this.props.someAction(); }
it will work.

I guess it has something to do with how the babel helper handles the arguments and/or the export/imports.
But I am not sure at all.

thanks for your help sofar

This seem an unrelated issue.
Can you open a new one posting your Babel config and, if possible, how Babel transpiles that code? You should be able to find it somewhere in the localhost url written in the red screen.

@nicolo-ribaudo
opened an issue like you suggested
10193

Hi guys !
@nicolo-ribaudo Thank you so much !
However, I would like to inform you that I get another issue which comes from redux (I use react-native) : _"Property description must be an object"_ with function _objectSpread2 from nodes_modules/redux.

To solve it, I've to fix redux version to 4.0.0 :
https://github.com/reduxjs/redux/issues/3468#issuecomment-510046458

Maybe there is a link with babel ? I think, because it's the same issue with declaration of var source = arguments[i] != null ? arguments[i] : {}; inside if condition instead of before.

I'm still finding ReferenceError: _objectSpread is not defined is cropping up in 7.5.4 but only when running tests via Jest. My initial suspicion is that it's going to be something in my config that's not working correctly. Will continue to diagnose and if there is anything that I find, happy to update here. Otherwise, assume that I've done something silly 馃槈

edit: I found it was dying when a _second_ spread existed on the same page. I tried creating a minimal-case reduction and it worked just fine. Huh? So I brought that minimal case back to the same folder as the original repo and it _failed_, even after removing node_modules and reinstalling. Double huh? Deleted and recreated the yarn.lock file and _then_ it started to behave. Now it's happy.

Leaving this note here in case anyone finds a similar issue remaining, hope it helps.

@mikehdt We are tracking it at https://github.com/babel/babel/issues/10179!

@JordanProtin It's because redux updated the Babel version to the buggy one; in 4.0.4 it's fixed.

@JordanProtin It's because redux updated the Babel version to the buggy one; in 4.0.4 it's fixed.

Thank you for your answer @nicolo-ribaudo

Hey @nicolo-ribaudo, thanks again for all your help on this. This issue was resolved for us 2 days ago, and we were able to continue working on our React Native app. However we just pushed our app.aab to the Google Play Store for internal testing, and the app crashes when downloaded from the play store, despite it working fine when running on simulators and devices not through the play store.

It's the original error of "undefined is not a function(evaluation 'Object.getOwnPropertyDescriptors(arguments[i])')". @babel/core and @babel/runtime and @babel/helpers and everything are all at 7.5.4 in our lockfile, and I looked at the lines of code in that /@babel/helpers/lib/helpers.js file that you made changes to in previous PRs, and I can't find any instances of the function supposedly causing the error with arguments[i] as the argument (as I recall you changed that to "source" each time). So it makes sense that I can't find it, but odd that the error finds it.

Any insight on this is appreciated!

Maybe for some reason it still used an old version of Babel when building the APK? Maybe there is a "production cache"?

(ALERT: I have never created an android app)
Is it possible to decompile the APK and look at it's JavaScript source code? If it is, then Ctrl+F for Object.getOwnPropertyDescriptors(arguments[i])') and post the surrounding code.

this solved the caching problem and after that it used the new version of Babel.

yarn:

watchman watch-del-all &&
rm -rf $TMPDIR/react-native-packager-cache-* &&
rm -rf $TMPDIR/metro-bundler-cache-* &&
rm -rf node_modules/ &&
yarn cache clean &&
yarn install &&
yarn start -- --reset-cache

Hi guys, does anyone fix it?

Yes, v7.5.4

@nicolo-ribaudo
Like this?

"devDependencies": {
"babel-jest": "24.8.0",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.55.0",
"react-test-renderer": "16.6.3",
"@babel/runtime": "7.5.4",
"@babel/core": "7.5.4",
"@babel/helpers": "7.5.4"
}

I've changed and run npm install again then react-native run-android but still occur that error :(

What's your package-lock.json file?

I have same issue.

"@babel/core": "^7.5.5", "@babel/helpers": "^7.5.5", "@babel/runtime": "^7.5.5", "metro-react-native-babel-preset": "^0.55.0", "babel-eslint": "10.0.2",

@nicolo-ribaudo Alright. Thanks a lot. I've to restart my PC and it works ;)

@AkioUnity change babel version to 7.5.4 like @nicolo-ribaudo said :)

7.5.5 should work too. @AkioUnity Please check in your lockfile that you don't have an older @babel/helpers or @babel/runtime version.

Yes. it is working fine now.
Thank you @nicolo-ribaudo

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dashed picture dashed  路  32Comments

amereii picture amereii  路  44Comments

budarin picture budarin  路  34Comments

ocombe picture ocombe  路  35Comments

ForbesLindesay picture ForbesLindesay  路  33Comments