question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PropTypes from React package on 0.45.1 release builds failing

See original GitHub 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; 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
murat-mehmetcommented, Jul 2, 2017

for me running the following fixed it without additional clean:

npm install react@16.0.0-alpha.12

13reactions
bartolkaruzacommented, Jun 20, 2017

@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 package 0.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 both React.createClass and to import {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 to React.createClass and PropTypes} from 'react' are already removed, at your own risk. 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found