draft-js-markdown-shortcuts-plugin icon indicating copy to clipboard operation
draft-js-markdown-shortcuts-plugin copied to clipboard

Incompatibility with create-react-app?

Open mtlatif opened this issue 7 years ago • 6 comments

Hi,

I could not get the example code to run with create-react-app. I also tried a simple web pack deployment solution to no avail. I get several errors during markdown substitutions such as this one:

Uncaught TypeError: Cannot read property 'get' of undefined at getUpdatedSelectionState (http://localhost:3000/static/js/bundle.js:28787:35) at getDraftEditorSelectionWithNodes (http://localhost:3000/static/js/bundle.js:28298:23) at getDraftEditorSelection (http://localhost:3000/static/js/bundle.js:48661:10) at editOnSelect (http://localhost:3000/static/js/bundle.js:48143:27) at http://localhost:3000/static/js/bundle.js:44738:19 at Object.ReactErrorUtils.invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:19854:16) at executeDispatch (http://localhost:3000/static/js/bundle.js:19361:21) at Object.executeDispatchesInOrder (http://localhost:3000/static/js/bundle.js:19384:5) at executeDispatchesAndRelease (http://localhost:3000/static/js/bundle.js:13363:22) at executeDispatchesAndReleaseTopLevel (http://localhost:3000/static/js/bundle.js:13374:10) at Array.forEach (native) at forEachAccumulated (http://localhost:3000/static/js/bundle.js:34862:9) at Object.processEventQueue (http://localhost:3000/static/js/bundle.js:13577:7) at runEventQueueInBatch (http://localhost:3000/static/js/bundle.js:68734:18) at Object.handleTopLevel [as _handleTopLevel] (http://localhost:3000/static/js/bundle.js:68745:5) at handleTopLevelImpl (http://localhost:3000/static/js/bundle.js:68832:24) at ReactDefaultBatchingStrategyTransaction.perform (http://localhost:3000/static/js/bundle.js:16234:20) at Object.batchedUpdates (http://localhost:3000/static/js/bundle.js:68575:26) at Object.batchedUpdates (http://localhost:3000/static/js/bundle.js:8655:27) at dispatchEvent (http://localhost:3000/static/js/bundle.js:68907:20) :3000/static/js/bundle.js:47692

I tested the demo code and it works perfectly fine. It's probably a silly oversight on my part but I can't figure out why the demo works but not any of my implementations.

Please look into it. Thanks

mtlatif avatar Jun 21 '17 05:06 mtlatif

same issue with create-react-app shot 2017-06-29 17 11 08

hugski avatar Jun 29 '17 09:06 hugski

I can't confirm this, I'm running a huge create-react-app-based app and it's working perfectly!

mxstbr avatar Jul 20 '17 00:07 mxstbr

I will test again and confirm. I was just watching your React Amsterdam video. You are an inspiration. Keep up the good work.

mtlatif avatar Jul 20 '17 00:07 mtlatif

Thank you, I appreciate that! 😊

mxstbr avatar Jul 20 '17 01:07 mxstbr

I had this issue when I was using 2.0.0-beta1 of draft-js-plugins-editor (the default at the time if you don't specify a version). I upgraded to 2.0.0-rc3 and the issue is no longer there.

michaelcox avatar Aug 10 '17 15:08 michaelcox

Can confirm @michaelcox answer.

lhnrd avatar Oct 04 '17 16:10 lhnrd