PropTypes from React package on 0.45.1 release builds failing
See original GitHub issueRelease 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;
in LayoutPropTypes.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?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:19 (1 by maintainers)
Top Results From Across the Web
Typechecking With PropTypes - React
PropTypes has moved into a different package since React v15.5. Please use the prop-types ... It should return an Error // object if...
Read more >React Native 45 Errors in Jest
At Build.com, a co-worker and I are in the process of updating our app to the most recent version of React Native, 0.45.1....
Read more >Why is the system looking for 'react-is` inside `prop-types`?
It is a package, but it's looking for it inside prop-types for some reason. This error started when I imported a React Bootstrap...
Read more >How to validate React props using PropTypes - LogRocket Blog
Prior to React v15.5.0, a utility called PropTypes was available as part of the React package, which provided a lot of validators for ......
Read more >prop-types | Yarn - Package Manager
Build Status. Runtime type checking for React props and similar objects. You can use prop-types to document the intended types of properties passed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
for me running the following fixed it without additional clean:
@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
^16.0.0-alpha.12
and the React Native package0.45.1
. This is the default combination if you upgrade your project to 0.45.1, causing the issue. In the React Native codebase, there are references to bothReact.createClass
and toimport {PropTypes} from 'react'
; Just search for it in your node_modules/react-native/Libraries if you do not feel that this could be true.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
master
, where the references toReact.createClass
andPropTypes} from 'react'
are already removed, at your own risk. 😃