Skip to content

Failed prop type: Calling PropTypes validators directly error #696

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

Closed
Orgil opened this issue May 11, 2017 · 20 comments
Closed

Failed prop type: Calling PropTypes validators directly error #696

Orgil opened this issue May 11, 2017 · 20 comments

Comments

@Orgil
Copy link

Orgil commented May 11, 2017

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

@gaearon
Copy link
Contributor

gaearon commented May 11, 2017

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

@Orgil
Copy link
Author

Orgil commented May 11, 2017 via email

@gaearon
Copy link
Contributor

gaearon commented May 11, 2017

Can you provide a project reproducing this?

@Orgil
Copy link
Author

Orgil commented May 12, 2017

@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

@timdorr
Copy link
Member

timdorr commented May 12, 2017

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?

@Orgil
Copy link
Author

Orgil commented May 12, 2017

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

@Orgil
Copy link
Author

Orgil commented May 12, 2017

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

@timdorr
Copy link
Member

timdorr commented May 12, 2017

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?

@Orgil
Copy link
Author

Orgil commented May 12, 2017

chrome 57.0.2987.133. also on firefox 53 generate error.

@Orgil
Copy link
Author

Orgil commented May 12, 2017

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.

@Orgil
Copy link
Author

Orgil commented May 12, 2017

turns out this is prop-types issue. facebook/prop-types#38

@timdorr
Copy link
Member

timdorr commented May 12, 2017

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.

@timdorr timdorr closed this as completed May 12, 2017
@gaearon
Copy link
Contributor

gaearon commented May 12, 2017

Please see facebook/prop-types#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.

@gaearon gaearon reopened this May 12, 2017
@gaearon
Copy link
Contributor

gaearon commented May 12, 2017

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

@timdorr
Copy link
Member

timdorr commented May 12, 2017

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. 👍

@gaearon
Copy link
Contributor

gaearon commented May 12, 2017

Always so helpful. Thank you @timdorr!

@timdorr
Copy link
Member

timdorr commented May 17, 2017

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!

@timdorr
Copy link
Member

timdorr commented May 18, 2017

OK, 5.0.5 is out!

@timdorr timdorr closed this as completed May 18, 2017
@markerikson
Copy link
Contributor

@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 .

@patialmanoj
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants