React-redux: Failed prop type: Calling PropTypes validators directly error

Created on 11 May 2017  ·  20Comments  ·  Source: reduxjs/react-redux

as my investigation, it happens after importing connected component from library. is it possible that validators are called once converted by babel?

Most helpful comment

OK, 5.0.5 is out!

All 20 comments

Please specify versions of react-redux and react you are using.

react 15.5.4
redux 3.6.0
react-redux 5.0.4
On Thu, May 11, 2017 at 18:59 Dan Abramov notifications@github.com wrote:

Please specify versions of react-redux and react you are using.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/reactjs/react-redux/issues/696#issuecomment-300755847,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeGHALPLjU0d4GmKmmlNV1gP4yOiR0-ks5r4uongaJpZM4NX1YI
.

Can you provide a project reproducing this?

@gaearon Here are 2 repos that reproduce the issue. test-lib is packed by webpack/babel as a library, other one uses this lib.

https://github.com/Orgil/test-lib
https://github.com/Orgil/test-app

I'm not seeing that error pop up. Everything renders correctly and nothing comes up on the console. When are you seeing this error? Have you tried deleting your node_modules folder and reinstalling?

thats weird. Just running this showing error on my end. those 2 are fresh repos i just created.

btw, this might be helpful. i'm using node 6.10.3. in order to test lib repo is locally linked to app.

I'm on a newer node, but that shouldn't apply since this runs in the browser. I did the same with npm link.

What browser (with version) are you using?

chrome 57.0.2987.133. also on firefox 53 generate error.

I'm on mac and just tried on linux it is generating same error 3 times. if i remove connect from test-lib it generates error 1 time. really confused.

turns out this is prop-types issue. https://github.com/reactjs/prop-types/issues/38

Well, that's upstream of us. Nothing we can do about that here. I'll make sure we stay up to date on the deps if that involves a breaking change on prop-types.

Really weird I'm not seeing the error. I'm on Chrome 58, so I should be seeing it, but I'm not.

Please see https://github.com/reactjs/prop-types/issues/38.

This was a false positive caused by production version of prop-types generating a mistaken warning when development version of React is calling it.

It is fixed in [email protected].

You might need to rebuild the UMD bundle of the component that depends on prop-types to see the changes.

I think this means we need another pair of react-redux releases with rebuilt UMD bundles.
I’m sorry 😞

No worries, I can get that done. I'm going to look into #680/#681 before doing so, since it's a good time to roll that all together (pun intended) anyways.

And I'll do a 3.7.0 on Redux to get the Rollup-ed UMD build on there at the same time. I'll be able to get to that tonight or tomorrow. 👍

Always so helpful. Thank you @timdorr!

Sorry about the mis-fire this weekend. I'm having a busy time at work with a big product release on the 30th (culmination of 2 years of work!) and that obviously has my focus, including weekends. We're getting close to having it all worked out, so I'll try to find some time tonight to review things and get this pushed out. Sorry for the delays!

OK, 5.0.5 is out!

@patialmanoj :
This is a bug tracker, not a support system. For usage questions, please use Stack Overflow or Reactiflux where there are a lot more people ready to help you out - you'll probably get a better answer faster. Thanks!

That said, I don't think you're experiencing the error described in this issue. Your error says that PropTypes.Array is undefined. My guess is that you're trying to do import React, {PropTypes} from "react", but that no longer works in React 16. Instead, you need to do import PropTypes from "prop-types". See https://reactjs.org/docs/typechecking-with-proptypes.html and https://reactjs.org/blog/2017/09/26/react-v16.0.html#upgrading .

thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cpprookie picture cpprookie  ·  3Comments

mharrisweb picture mharrisweb  ·  3Comments

a-koka picture a-koka  ·  3Comments

IbraheemAlSaady picture IbraheemAlSaady  ·  3Comments

julienvincent picture julienvincent  ·  4Comments