-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
PropTypes from React package on 0.45.1 release builds failing #14588
Comments
@bartolkaruza If you are using react >=15.5 you should change to prop-types package. https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html |
Same for me. If React 16 alpha is the "supported" version for React Native 0.45.1, I really don't know how can |
@tuneZola the crash is happening in the RN codebase, not our app code base. Also, the same was happening for People will run into this issue if they upgrade to RN 45.1. Similar issues are being raised like #14590 . Maybe it would be a good idea to cut another release that fixes this soon?
|
I am experiencing the same issue after upgrading to 0.45.1 |
@bartolkaruza Did you read the link that I posted? This was the start of the moving of those two items. If you are used React 16.0.0, PropTypes and createClass are not in the React package anymore. You will have to change back to React 15.6.1 or some other 15.* package. |
@tuneZola how we can change them if they in RN code? And how they even can be in RN code if it's supports 16+ React? for ex. - react-native\Libraries\StyleSheet\LayoutPropTypes.js:14 'var ReactPropTypes = require('React').PropTypes;' |
It is seperated from react.. install npm i -S prop-types import import PropTypes from 'prop-types'; // ES6
var PropTypes = require('prop-types'); // ES5 with npm more info: |
@Stoffern @tuneZola Just to help clarify this discussion. The issue is not wrong usage of the prop-types package by implementers. If you have prop-types in your package.json, it does not resolve the issue. The issue is wrong usage of prop-types from the React package in the React Native Libraries; Basically, there is a mismatch between the React package You can work around this by either downgrading the react version to pre-16, but I don't know what the potential impact is of that, I haven't tried it. Or using the non-released React Native code from |
My bad, sorry. thanks for clarification @bartolkaruza |
@bartolkaruza I'm not sure, but it seems like i finally got it working (though I only tried it on my emulator). what I did was:
I guess something changed in the packages, which are upgraded on the first step, or, maybe, some old libraries were somehow cached. Now it runs ok, at least on my emulator. I also did not try it with release builds, but at least it helped to continue my development. And logs still show some warnings about PropTypes (though we've set them up correctly according to migration guide), maybe because of some libraries. |
@angryanatole That's great! I'm worried that something goes wrong in the minification step in release builds that cause the issue to appear, but I'm not sure. Would you mind trying a release build to confirm this? I did not have the issue in debug builds before at all. |
Been going crazy with this one all day. This only was happening to me in release builds as well, but now the error is showing up in debug. At least its replicable! Unfortunately cannot try @angryanatole's suggestion since |
@bartolkaruza Ok, that makes since. |
@bartolkaruza no problem, just made a release build with the help of the official tutorial (we've just started, so we haven't done release builds for RN apps yet), everything seems to be fine, tested on my device and emulator. Hope this information helps! @jjshammas if I am not mistaken, I didn't have this issue with debug builds for a couple of days after upgrading to 45.1. But it showed up yesterday, and I was really surprised. Maybe the problem was in the cached files - I don't know for sure, that's just my suggestion. UPD: also forgot to mention, that after upgrading RN I ran I'm a bit confused about this issue too, hope we'll get more information soon. |
Have the same issue as well after upgrading to 0.45.1 via react-native-git-upgrade. Was working fine previously on 0.44.2 |
There's been several issues opened about this in the past week. The fix should be on master now. All that is left is to get the fix into a new 0.45 release. This is being tracked in #14712. |
fix issue for me:
"react": "^16.0.0-alpha.12", |
for me running the following fixed it without additional clean:
|
Guys could you please advise how you solved this issue. I changed react and react-native versions, but the problem is stacked there still. Please help to solve the issue. |
Release builds are failing for Android on the 0.45.1 release of React Native. I've only tested this on Android, but I suspect the same is true for iOS.
Lines such as
var ReactPropTypes = require('React').PropTypes;
inLayoutPropTypes.js
(among several others) are causing this.The result is a crash on startup with a js exception:
com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'ReactPropTypes.shape'), stack:
I'm aware that this is fixed on the master branch. I thought I would report this issue still, as it effectively cripples the 0.45.1 release and I need to release against master to make our app release builds work.
@andrewimm I see you fixed these lines on master, maybe you know what is going on here?
The text was updated successfully, but these errors were encountered: