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

Unhandled JS Exception: undefined is not an object (evaluating 'PropTypes.func') #95

Open
olix21 opened this issue May 25, 2016 · 14 comments

Comments

@olix21
Copy link

olix21 commented May 25, 2016

Hello,

We are making a react native project with you're awesome webview bridge.
We just upgrade to react native 0.26.1 and react 15.0.2 this morning and we have now this PropTypes issue.

Is it possible that certain pieces of your code are depreciated?

@KeinborgMichael
Copy link

use files from git , not from npm

@g6ling
Copy link
Contributor

g6ling commented Jun 5, 2016

use npm i https://github.com/alinz/react-native-webview-bridge

@olix21
Copy link
Author

olix21 commented Jun 7, 2016

Related to #92

@AlekseyKutsko
Copy link

AlekseyKutsko commented Oct 25, 2017

I have same problem.
I use npm i https://github.com/alinz/react-native-webview-bridge, but this not help me.
any solutions?

@io-pan
Copy link

io-pan commented Oct 28, 2017

Works fine with RN 0.44.2

But I'm having the problem with RN 0.49.3
even using npm i https://github.com/...

@AlekseyKutsko
Copy link

Thanks, works with RN 0.44.2.

@thejacobseely
Copy link

thejacobseely commented Nov 7, 2017

After doing some research, I discovered that "PropTypes" has been migrated to its own package.
(For more details, see https://reactjs.org/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes)).

I solved the issue by changing the following in index.ios.js:
var { PropTypes } = React;
to
var PropTypes = require("prop-types");

After that, I got an error with React.createClass (also caused by another change in React, and resolved by adding the new package), which I solved by adding the following to index.ios.js:
var createReactClass = require('create-react-class');

and then changing:
var WebViewBridge = React.createClass({
to
var WebViewBridge = createReactClass({

Hope that helps!

PS The fact that it works with older versions is probably because they have not upgraded React. When you upgrade ReactNative you will probably have to make the same changes.

It appears that this error will go away after this pull request is approved:
#243

@Timoteus78
Copy link

@thejacobseely Thanks for your comment, that def got me further. Though now I run into "RCTWebViewBridge" does not exist I noticed that the latest branch (V2) hasn't been touched for 11 months and has diverged a lot from master. Did you end up getting it to work?

@jgartner1
Copy link

@thejacobseely @Timoteus78 I have the same issue. It just can't resolve RCTWebViewBridge The error message is:

"Invariant Violation: Native component for "RCTWebViewBridge" does not exist"

And linking it with npm link as @JF-13 suggested it didn't help at all. The error persits. @Timoteus78 have you found a solution to this already? If so please tell me, I really need this WebViewBridge. And yeah that's an interesting question wheter @thejacobseely got it working??

fbonjour81 added a commit to fbonjour81/react-native-webview-bridge that referenced this issue Apr 30, 2018
fbonjour81 added a commit to fbonjour81/react-native-zss-rich-text-editor that referenced this issue Apr 30, 2018
@fonko
Copy link

fonko commented May 6, 2018

@thejacobseely i follow your instrucctions and still have undefined is not an object (evaluating 'PropTypes.func')

:(

@ShridharCodewave
Copy link

@thejacobseely I encountered same problems and I followed your steps but after replacing
var WebViewBridge = React.createClass({ by var WebViewBridge = createReactClass({
Iam getting a new error saying "can't find variable: createReactClass".
Does anyone know solution for this problem?

@prospegto
Copy link

prospegto commented Aug 6, 2018

@ShridharCodewave Did you add it?
var createReactClass = require('create-react-class');
@fonko Same as you and then I realised I was changing the files in react-native-webview-bridge-updated instead of react-native-webview-bridge

@ShridharCodewave
Copy link

@prospegto Yes I did and the issue is solved now :)

@jeanniton-mnr
Copy link

Hello!
I have followed @winadiw instructions posted here and it worked for me.
And I think it'd also be good if we merge those two open issue and/or mark them as solved.

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