Invariant Violation running example
See original GitHub issueI ran the following commands to set up the example:
npm install
npm install react
npm install react-dom
npm run build
npm run build:example
cd example
node server
And when I open up localhost:3000
I see this error:
localhost/:45 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).
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
GraphQL mutation - Must contain a query definition
I'm using the @rest call from the Apollo Client docs. They use a gql query string, followed by a client.query({ query }) api...
Read more >Invariant Violation: Must contain a query definition.
Invariant Violation: Must contain a query definition. Luan Marques. client.mutate({ mutation: gql` mutation { addTeam(input:{name:"Somename" ...
Read more >invariant violation viewproptypes has been removed - You.com
`ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. ERROR ...
Read more >Redux testing - Invariant violation error - Hao's learning log
Test suite failed to run Invariant Violation: You must pass a ... SpendPointsMenu in this case is the Component in my example above, ......
Read more >"Application has not been registered" error
When developing an Expo or React Native app, it's not uncommon to run into an error that looks like ... Invariant Violation: "main"...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@NickyYo Sounds like you have an issue with multiple reacts. If you’re making a reusable component that includes react-ace, make sure react/react-dom are in devDependencies and peerDependencies, not dependencies (http://stackoverflow.com/questions/30451556/what-is-the-correct-way-of-adding-a-dependency-to-react-in-your-package-json-for).
This gets funky when you use
npm link
because that doesn’t install in the same way; it’s just a symlink to the linked dependency, which means it’ll pull in all of the installed dependencies, including the manually install react/react-dom. If you use a bundler like webpack, you can alias all import of react by putting this in theresolve
section:This forces all component to use the base project’s react modules.
Thanks @drewen !