Getting a React related warning message about PropTypes access

After the last update I started getting this error on my console:

Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.

I want to point out that I’m NOT using React, I never used React at all. Just to be sure that the issue was Auth0 I removed all the reference to Auth0 from my app (and only those to Auth0) and the error did actually disappear. I have no idea what that means.

The issue can be reproduced when importing Auth0 Lock 10.14.0 and as you can see here, it has already been reported in the Lock repository at GitHub.

The issued linked previously was closed with an associated fix very recently (about an hour ago in relation to the time this answer was posted) so this should be resolved in a next release of Auth0 Lock.

As further information, the warning was caused by a somewhat recent update from React so the warning itself may still be seen while the entire ecosystem of libraries using React update to the new approach. However, for your specific issue the next release of Auth0 Lock should be sufficient to address this as you mention you do not use anything from React and the warning went away if the Auth0 dependencies were removed.

Will the new update also kill the React dev tool’s spam? Download the React DevTools for a better development experience: https://fb.me/react-devtools again I don’t use React and having random spam in the console is annoying.

On another note I appreciate the fact that you guys answer in the forum and fix the issues.

If you reference a built version of Lock from CDN that message should not appear, however, if you include Lock through npm and then bundle it, for example, with Angular CLI or other tooling I believe you’ll need to make sure that within the compiled JS bundle process.env.NODE_ENV === 'production' otherwise React will show that message.

When doing development I believe the message is unavoidable as you won’t want to set that variable to production. Showing that message is a decision from React and I don’t believe we’ll stop using React so by proxy it will display when using Lock.

I can’t say that what you are telling me was unexpected, and all I can possibly do now is vent and being p***ed with React for spamming in everybody console. Shame on them.

Note that this has been fixed as of Lock v10.15.0.