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 an object(evaluating 'react_PropTypes.oneOf') #575

Closed
Balasnest opened this issue Oct 17, 2017 · 12 comments
Closed

undefined is not an object(evaluating 'react_PropTypes.oneOf') #575

Balasnest opened this issue Oct 17, 2017 · 12 comments

Comments

@Balasnest
Copy link

I'm currently experiencing an issue with this.

undefined is not an object(evaluating 'react_PropTypes.oneOf')

Check this screenshot: http://prntscr.com/gyd6dl

version:
"react": "^16.0.0-rc.3",
"react-native": "^0.48.3",

How to resolve this?

@ChrisFeldmeier
Copy link

same issue here. Anyone a idea?

@oblador
Copy link
Owner

oblador commented Oct 22, 2017

Make sure you've updated this package to the latest version.

@vladbars
Copy link

the same issue
"react": "16.0.0",
"react-native": "^0.45.1",
"react-native-vector-icons": "^4.4.2"

@gvillenave
Copy link

gvillenave commented Oct 31, 2017

Same issue after upgrading to react-native 0.49.5 and react 16.0.0-beta.5, with the latest version of the vector icons NPM package, same thing with master.

@mtzfactory
Copy link

same here...

@alfonso1003
Copy link

alfonso1003 commented Nov 27, 2017

Same issue:

"react": "^16.1.1",
"react-native": "0.50.3",
"react-native-material-design": "^0.3.7",
"react-native-vector-icons": "^4.4.2",

@alfonso1003
Copy link

alfonso1003 commented Nov 28, 2017

Same here.

"react": "^16.1.1",
"react-native": "0.50.3",
"react-native-material-design": "^0.3.7",
"react-native-vector-icons": "^4.4.2",

I researched this more, and it turns out that PropTypes has been taken out of the standard library, so React.PropTypes doesn't work anymore.

More information here:
https://stackoverflow.com/a/44911525/2168400

I grepped the react-native-vector-icons codebase and all the references to React.PropTypes have been updated. I think the issue is in another package, not this one. In my case, I'm seeing that react-native-material-design is still using React.PropTypes and has react-native-vector-icons as a dependency.

$ pwd
/[myProjectPath]/node_modules/react-native-material-design
$$ ll
total 24
-rw-r--r--   1 ahernandez  staff     0 Jul 27  2016 CONTRIBUTING.md
-rw-r--r--   1 ahernandez  staff  1100 Jul 27  2016 LICENSE
-rw-r--r--   1 ahernandez  staff  3367 Jul 27  2016 README.md
drwxr-xr-x  22 ahernandez  staff   704 Nov 27 21:29 lib
drwxr-xr-x  19 ahernandez  staff   608 Nov 27 21:29 node_modules
-rw-r--r--   1 ahernandez  staff  2514 Nov 27 21:29 package.json
$ grep -r vector-icon ./package.json
./package.json:    "react-native-vector-icons": "^2.0.1"
$ grep -r React.PropType .
./node_modules/react-native-vector-icons/RNIMigration.js:    name: React.PropTypes.string.isRequired,
./node_modules/react-native-vector-icons/RNIMigration.js:    size: React.PropTypes.number,
./node_modules/react-native-vector-icons/RNIMigration.js:    color: React.PropTypes.string,

I'm going to manually update the code there, and I'll report back if that worked or not.

@alfonso1003
Copy link

alfonso1003 commented Nov 28, 2017

Update: I tried updating the code manually, but it's not written in React or ES6 and I could only guess at the syntax. I'm not a Javascript expert, obviously... I'm switching from react-native-material-design to react-native-elements instead, since it looks like the issue is cleared up there.

If you're using react-native-material-design, I brought what I found to their attention:
invertase/react-native-material-design#174

@oblador
Copy link
Owner

oblador commented Dec 19, 2017

Seems like maybe you have another third party dependency which depends on an older version of RNVI. @alfonso1003: Your grep shows "react-native-vector-icons": "^2.0.1" which def is out of date.

Please confirm that the version in your node_modules folder is actually the latest version and that there's not multiple versions installed via third party deps.

@Chris-Petty
Copy link

Chris-Petty commented Dec 22, 2017

I am also having this issue:
RNVI: 4.4.3 (confirmed in node modules)
React: 16.0.0
RN: 0.51.0
Prop-types: 15.6.0

Tried downgrading prop-types to match that in RNVI: ^15.5.10. This doesn't have any effect on the bug.

Can confirm that downgrading to [email protected] fixes the issue in debug as described here #443 (comment) (but I don't seem to be able to build an APK that works using the alpha!)

@Chris-Petty
Copy link

Fixed the issue for me as #588 (comment). Was using a another dependency that relied on [email protected], this was using React.Proptypes which is deprecated in React 16.

@oblador
Copy link
Owner

oblador commented Jan 8, 2018

Closing this one too :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants