react-markdown-editor icon indicating copy to clipboard operation
react-markdown-editor copied to clipboard

Uncaught Error: Element ref was specified as a string (editor) but no owner was set.

Open MehrnooshHajkhalil opened this issue 8 years ago • 9 comments

I am using this package and before I didn't have any problem. but after updating react with npm install, this issue happen. When The page is rendering this component produce three errors and all the page goes blank. I do research but I found nothing useful. I don't know how to fix this. Here is my errors in chrome's console :

invariant.js:42 Uncaught Error: Element ref was specified as a string (editor) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner). at invariant (invariant.js:42) at coerceRef (react-dom.development.js:8579) at reconcileSingleElement (react-dom.development.js:9379) at reconcileChildFibers (react-dom.development.js:9477) at reconcileChildrenAtPriority (react-dom.development.js:10127) at reconcileChildren (react-dom.development.js:10118) at finishClassComponent (react-dom.development.js:10254) at updateClassComponent (react-dom.development.js:10226) at beginWork (react-dom.development.js:10605) at performUnitOfWork (react-dom.development.js:12573)

react-dom.development.js:8305 The above error occurred in the <MarkdownEditorContent> component: in MarkdownEditorContent in div in MarkdownEditor (created by TopicEditComponent) in div (created by TopicEditComponent) in div (created by TopicEditComponent) in div (created by TopicEditComponent) in div (created by TopicEditComponent) in form (created by TopicEditComponent) in div (created by TopicEditComponent) in TopicEditComponent (created by TopicComponent) in div (created by TopicComponent) in TopicComponent (created by CountryContainer) in div (created by CountryContainer) in CountryContainer (created by Connect(CountryContainer)) in Connect(CountryContainer) (created by RouterContext) in div (created by CoreLayout) in div (created by CoreLayout) in CoreLayout (created by RouterContext) in RouterContext (created by Router) in Router (created by Routes) in Routes in Provider Consider adding an error boundary to your tree to customize error handling behavior. You can learn more about error boundaries at https://fb.me/react-error-boundaries.

react-dom.development.js:1345 Uncaught Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://fb.me/react-crossorigin-error for more information. at Object.invokeGuardedCallbackDev (react-dom.development.js:1345) at invokeGuardedCallback (react-dom.development.js:1195) at performWork (react-dom.development.js:12800) at batchedUpdates (react-dom.development.js:13244) at performFiberBatchedUpdates (react-dom.development.js:1646) at stackBatchedUpdates (react-dom.development.js:1637) at batchedUpdates (react-dom.development.js:1651) at Object.batchedUpdatesWithControlledComponents [as batchedUpdates] (react-dom.development.js:1664) at dispatchEvent (react-dom.development.js:1874)

MehrnooshHajkhalil avatar Nov 10 '17 14:11 MehrnooshHajkhalil

The error is caused by this: https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs

jaywcjlove avatar Nov 22 '17 01:11 jaywcjlove

have you fixed this? I got the same error, while working on a modal using antd. Don't know how to fixed it.

gerryl1991 avatar Jan 30 '18 03:01 gerryl1991

Hi, Sorry for not answering before. I didn't receive any notifications in my emails. I apologize.

@MehrnooshHajkhalil @gerryl1991 What version of react are you using?

jrm2k6 avatar Feb 08 '18 01:02 jrm2k6

16.x sir

On Feb 8, 2018 9:15 AM, "Jeremy Dagorn" [email protected] wrote:

Hi, Sorry for not answering before. I didn't receive any notifications in my emails. I apologize.

@MehrnooshHajkhalil https://github.com/mehrnooshhajkhalil @gerryl1991 https://github.com/gerryl1991 What version of react are you using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jrm2k6/react-markdown-editor/issues/55#issuecomment-363969313, or mute the thread https://github.com/notifications/unsubscribe-auth/ALaTiy0fpzr4yDT8SbKEqXZSGnMSxXVjks5tSkqigaJpZM4QZosH .

gerryl1991 avatar Feb 08 '18 11:02 gerryl1991

Thanks. Will check.

jrm2k6 avatar Feb 09 '18 20:02 jrm2k6

I'm getting this too, any resolution? I am using: react: 16.2.0 react-dom: 16.2.0

I was seeing it on 16, then upgraded, still seeing it.

dsacramone avatar Mar 23 '18 19:03 dsacramone

@dsacramone I didn't get to it yet. Let me see if I can fix the issue this weekend. I haven't released the library compatible with React 16 yet.

jrm2k6 avatar Mar 24 '18 17:03 jrm2k6

The issue right now is that Reflux is not compatible with React 16 as far as I can tell https://github.com/reflux/refluxjs/issues/537

jrm2k6 avatar Mar 24 '18 22:03 jrm2k6

@dsacramone @gerryl1991 @jaywcjlove @MehrnooshHajkhalil Can you try to install the package using: npm install --save react-markdown-editor@beta. That one should work with React 16.

jrm2k6 avatar Mar 25 '18 23:03 jrm2k6