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

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

Closed
azcodia opened this issue Jan 22, 2019 · 48 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.

Comments

@azcodia
Copy link

azcodia commented Jan 22, 2019

before it went smoothly, but after I made native react a new error occurred,
this is the problem
"undefined is not a function (evaluation 'object.getOwnPropertyDescriptors (arguments [i])')"

even though the code is not I add a little bit of input
and that makes me crazy

@punyasurya
Copy link

have the same issue here...

@thaitrandng
Copy link

have the same issue here... =))

@luolin2611
Copy link

Same problem

@gabsima-nexapp
Copy link

I've updated from react native 0.55 to 0.57 and i get this error on android while on ios everything works fine.

I've updated the dependencies in gradle in order to be able to build but i still get the error..

@react-native-bot
Copy link
Collaborator

We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

Please make use of the bug report template to let us know about a reproducible bug or regression in the core React Native library.

If you'd like to propose a change or discuss a feature request, there is a repository dedicated to Discussions and Proposals you may use for this purpose.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. 📋No Template labels Jan 22, 2019
@LuongTruong
Copy link

please re-open this issue, I have the same problem like them :(

@rodolphefauquez
Copy link

rodolphefauquez commented Jan 22, 2019

Same problem here, android only, without reason (it was working few hours ago for me).
But the error disappear if i enable the 'debug JS remotely' option...

@luolin2611
Copy link

Same problem

image

@LuongTruong
Copy link

@luolin2611 , that is it. I create a complete new project but the error appear at the first time running the project.

@mikecobas
Copy link

same problem

1 similar comment
@smallrig
Copy link

same problem

@luolin2611
Copy link

@luolin2611 , that is it. I create a complete new project but the error appear at the first time running the project.

.

I also run the error for the first time, and I can’t go.

@battajegroup
Copy link

exact same issue..

@congnt148
Copy link

Same problem

@Jay-flow
Copy link

same problem

1 similar comment
@melodion
Copy link

same problem

@LuongTruong
Copy link

I've updated from react native 0.55 to 0.57 and i get this error on android while on ios everything works fine.

I've updated the dependencies in gradle in order to be able to build but i still get the error..

Thanks @gabsima-nexapp , I move to iOS project to continue my work first and deal with Android later

@mohammed-fahad
Copy link

image
Same issue here.

@JintoAntony
Copy link

Same issue here.

@liuqing520it
Copy link

restart your computer to solve this problem

@nativeaditya
Copy link

Same issue here.

@carlmagumpara
Copy link

same problem here

@aldy010
Copy link

aldy010 commented Jan 22, 2019

I have exactly the same error here. my region is in Indonesia
react native 0 57 error
react native new project

@PIlepRusel
Copy link

restart your computer to solve this problem
does this fix the problem ?

@ken-talkingsource
Copy link

restart your computer to solve this problem
does this fix the problem ?

I restarted (my mac) but didn't solve this problem.

@huiruo
Copy link

huiruo commented Jan 22, 2019

react native undefined is not an object(evaluating 'Object.getOwnPropertyDescriptors(arguments[i])')

@aldy010
Copy link

aldy010 commented Jan 22, 2019

still no fix yet, tried the above solution

@mohsincox
Copy link

I restarted my computer, but did not solve the problem

@GantMan
Copy link
Contributor

GantMan commented Jan 22, 2019

I have a terrible fix.

I guessed that the problem was some kind of dependency upgrade, and because React Native does not come locked to working versions, something got published and broke it.

I grabbed a yarn.lock from a project from over the weekend, pasted that into my project's yarn.lock file and then did yarn at the command line to have it automatically prune/lock things back up. Somewhere in that mess, it grabbed the right stuff and now I can use Android again. Not a great fix, but hopefully it helps!

TL:DR;

  1. Copy this yarn.lock contents https://gist.github.com/GantMan/347fb4206fa7be141ff7133ba4859afd
  2. Past it over your project's yarn.lock contents
  3. run yarn in the CLI

@sunnylqm
Copy link
Contributor

@GantMan I just did the same thing. I saw mainly babel update when diffing a working version and a broken version. It is hard to tell what deps cause the break, so the best option is definitely to use a whole working lock file.

@elicwhite elicwhite reopened this Jan 22, 2019
@rolignu2
Copy link

please , reopen the issue. i have the same problem it probably because the object.getOwnPropertiesDescriptor doesn't exists anymore, the same happended on
react-native-keyboard-aware-scroll-view, the problem is on

node_modules/@babel/runtime/helpers/objectSpread.js

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

but i don't know how i can solve

@ashishmundra
Copy link

same issue here

@rolignu2
Copy link

rolignu2 commented Jan 22, 2019

Ok guys , i have a temporaly fix ,

go to

node_modules/@babel/runtime/helpers/objectSpread.js

find the LINE OF CODE :

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

Replace the line with this code:

     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]);
      });

I HOPE I CAN HELP US, THIS IS THE UNIQUE METHOD WHAT WORKS

@sunnylqm
Copy link
Contributor

sunnylqm commented Jan 22, 2019

@rolignu2 Thanks for locating the line, so I guess this pr of babel-helpers cause the problem. It forgot to check this function in else branch. Please fix this asap @hzoo @saschanaz

Workaround

Add the following to your package.json:

  "resolutions": {
    "@babel/helpers": "7.2.0",
    "@babel/runtime": "7.2.0"
  }

Then run rm -rf node_modules && yarn && yarn start --reset-cache

@mgwidmann
Copy link

@sunnylqm Wow merged 10 hours ago... Sad that the NPM world is like this.

babel/babel#9341

@rolignu2
Copy link

rolignu2 commented Jan 22, 2019

@sunnylqm thanks man to apply the revert.
@azcodia please close the issue. everything works well

@Jay-flow
Copy link

Jay-flow commented Jan 22, 2019

@rolignu2 Thanks for locating the line
I refer to the project I used before.
It is work for me.
node_modules/@babel/runtime/helpers/objectSpread.js
Replace with the code below in the path above.

var defineProperty = require("./defineProperty");

function _objectSpread(target) {
  for (var i = 1; i < arguments.length; i++) {
    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]);
    });
  }

  return target;
}

module.exports = _objectSpread;

@rahul356357
Copy link

@Army-92 solution works fine for me

@itgou
Copy link

itgou commented Jan 22, 2019

I have a terrible fix.

I guessed that the problem was some kind of dependency upgrade, and because React Native does not come locked to working versions, something got published and broke it.

I grabbed a yarn.lock from a project from over the weekend, pasted that into my project's yarn.lock file and then did yarn at the command line to have it automatically prune/lock things back up. Somewhere in that mess, it grabbed the right stuff and now I can use Android again. Not a great fix, but hopefully it helps!

TL:DR;

  1. Copy this yarn.lock contents https://gist.github.com/GantMan/347fb4206fa7be141ff7133ba4859afd
  2. Past it over your project's yarn.lock contents
  3. run yarn in the CLI

Thank you, it solved this problems of mine.

@sunnylqm
Copy link
Contributor

Babel just published a hotfixed version. Just remove your yarn.lock and yarn and this issue should be gone.

@bepehr
Copy link

bepehr commented Jan 22, 2019

@sunnylqm solution worked for me , just add that lines to package.json , and run yarn then run react-native run-android

@XieTongXue
Copy link

same problem, i delete the demo and run react-native init AwesomeProject again, fixed.

@raghulvaikundam
Copy link

run npm install in the project directory to fix the issue. This command will install the missed dependency for the react native project

@xinchanghao
Copy link

run npm install in the project directory to fix the issue. This command will install the missed dependency for the react native project

i tried it, it didn't work...

@xinchanghao
Copy link

Retry react-native init name,it's ok!

@raghulvaikundam
Copy link

run npm install in the project directory to fix the issue. This command will install the missed dependency for the react native project

i tried it, it didn't work...

maybe u check with your package.json. Tried with latest react-native version 0.57

@Dafa-Alla
Copy link

Dafa-Alla commented Jan 22, 2019

I solve this proplem now

1-Delete the old project and create a new project
 2-Then open the cmd for the project path and type
3-npm istall
Then
4-react-native init AwesomeProject
5- react-native run-android

@kelset
Copy link
Contributor

kelset commented Jan 22, 2019

Hey everyone, looks like this was a Babel issue - they should have published an hotfix on their side already, in the meantime to avoid too much noise I'll lock this issue.

A workaround can be found here - thanks @sunnylqm 👍


EDIT: the breaking change was reverted in babel/babel#9379 and released in: https://github.com/babel/babel/releases/tag/v7.3.1

Anyone facing this issue simply needs to nuke yarn lock etc.

@facebook facebook locked and limited conversation to collaborators Jan 22, 2019
@kelset kelset added Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used. 🔧Tooling labels Jan 22, 2019
@kelset kelset closed this as completed Jan 22, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.
Projects
None yet
Development

No branches or pull requests