Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Uncaught Invariant Violation: addComponentAsRefTo(...) #114

Open
jephir opened this issue Jun 23, 2016 · 9 comments
Open

Uncaught Invariant Violation: addComponentAsRefTo(...) #114

jephir opened this issue Jun 23, 2016 · 9 comments

Comments

@jephir
Copy link

jephir commented Jun 23, 2016

I'm trying to use lock-passwordless in my React application. After signing in using email code and seeing "Thanks for signing in.", this error appears in console:

Uncaught Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

My application is using [email protected]. NPM also shows this error: UNMET PEER DEPENDENCY [email protected] under the lock-passwordless tree.

@gnandretta
Copy link
Contributor

Lock passwordless works with React 0.14. I'll schedule some time to perform the upgrade to React 15.

@nlindroos
Copy link

@gnandretta Any updates on a schedule for React 15 support?

@ChristianDavis
Copy link

I get this as well, but on initial launch of the lock

@luisrudge
Copy link
Contributor

I'm having the same issue:
image

@nlindroos
Copy link

@luisrudge You need to use React v0.14 for now, since development on this library apparently has stopped.

@ChristianDavis
Copy link

We were able to get passed this by externalizing react from the project through webpack

@luisrudge
Copy link
Contributor

luisrudge commented Nov 2, 2016

@ChristianDavis right.. but this won't work with something like nextjs (https://github.com/zeit/next.js) or even create-react-app, since you don't have control of the webpack config

@djmitche
Copy link

I think you need to list React as a peer dependency. Loading two different versions of React is always going to lead to this issue. The other option would be to release a different version of auth0-lock-passwordless for each version of React, and asking users to select the lock version matching their react version.

@jeffgorder
Copy link

I'm getting this same issue.

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

No branches or pull requests

7 participants