React-native-gifted-chat: Cannot find prop-types

Created on 27 Jul 2017  路  12Comments  路  Source: FaridSafi/react-native-gifted-chat

Issue Description

Here is what I did:

  1. downloaded code
  2. go to example, run npm install
  3. react-native run-ios.

I got the following error:

Bundling index.ios.js 99.4% (327/328), failed.
error: bundling failed: "Unable to resolve module prop-types from /Users/jack/Dev/react-native-gifted-chat/src/GiftedChat.js: Module does not exist in the module mapnnThis might be related to https://github.com/facebook/react-native/issues/4968nTo resolve try the following:n 1. Clear watchman watches: watchman watch-del-all.n 2. Delete the node_modules folder: rm -rf node_modules && npm install.n 3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start -- --reset-cache.

Steps to Reproduce / Code Snippets

  1. downloaded code
  2. go to example, run npm install
  3. react-native run-ios.

Expected Results

[FILL THIS OUT]

Additional Information

  • React Native version: [0.46.3]
  • react-native-gifted-chat version: [latest]
  • Platform(s) (iOS, Android, or both?): [latest]

All 12 comments

Same here, the problem seems to be with react-native-parsed-text, react-native-lightbox and react-native-invertible-scroll-view (using old React.PropTypes & React.createClass) :

undefined is not an object (evaluating '_react2.default.PropTypes.shape')

<unknown>
    ParsedText.js:12:42
loadModuleImplementation
    require.js:174:12
<unknown>
    MessageText.js:11
loadModuleImplementation
    require.js:174:12
<unknown>
    Bubble.js:12
loadModuleImplementation
    require.js:174:12
<unknown>
    GiftedChat.js:17
loadModuleImplementation
    require.js:174:12
<unknown>
    <unknown file>:0
loadModuleImplementation
    require.js:174:12
<unknown>
    ChatScene.js:11
loadModuleImplementation
    require.js:174:12

How can i fix this issue?

You have to manually fix it by npm i -S prop-types and then go to every dependency which is using React.PropTypes notation or import React, {PropTypes} from 'react' and replace with import PropTypes from 'prop-types

Same issue here..and I hope there will be a better fix than manually updating

@ptfly can't be serious.. there are 27 files just in this repo that would need manual updating

Since this is blocking issue, can someone fix this and check in code? Thank you in advance.

+1

This problem vanished for me like magic when I changed the dev machine from an Ubuntu one to my local Mac. Don't know the reason at all. node version is on both machines 6.11.2, npm 3.10.10. Somehow node_moduleswere messed up. I solved the whole problem by uploading the node_modules folder from my Mac to the Ubuntu machine and problem was gone there too!

For me, node version is 8.2.1 and npm version is 5.3.0. Are these versions are too new to cause such issue?

Same issue here.

This is what I got when I run jest

    TypeError: Cannot read property 'propTypes' of undefined

      at Object.<anonymous> (node_modules/react-native-gifted-chat/src/GiftedAvatar.js:160:31)
      at Object.<anonymous> (node_modules/react-native-gifted-chat/src/Avatar.js:4:19)
      at Object.<anonymous> (node_modules/react-native-gifted-chat/src/GiftedChat.js:16:13)

  console.error node_modules/fbjs/lib/warning.js:36
    Warning: PropTypes has been moved to a separate package. Accessing React.PropTypes is no longer supported and will be removed completely in React 16. Use the prop-types package on npm instead. (https://fb.me/migrating-from-react-proptypes)

Please, try the latest version released today (v0.2.8).

Feel free to reopen if it does not work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

redwind picture redwind  路  3Comments

radvc picture radvc  路  3Comments

luisar picture luisar  路  3Comments

yogiben picture yogiben  路  3Comments

iamdurui picture iamdurui  路  3Comments