SamyPesse / draft-js-prism

Code highlighting for DraftJS using Prism
http://samypesse.github.io/draft-js-prism/
Apache License 2.0
275 stars 36 forks source link

Error createEmpty #24

Open zfha opened 5 years ago

zfha commented 5 years ago
/Users/zhoufan/Documents/electron/SEBrain/node_modules/draft-js-plugins-editor/lib/Editor/index.js:65 Uncaught TypeError: Cannot read property 'size' of undefined
    at getDecoratorLength (/Users/zhoufan/Documents/electron/SEBrain/node_modules/draft-js-plugins-editor/lib/Editor/index.js:65)
    at ProxyComponent.componentWillReceiveProps (/Users/zhoufan/Documents/electron/SEBrain/node_modules/draft-js-plugins-editor/lib/Editor/index.js:121)
    at callComponentWillReceiveProps (/Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:12564)
    at updateClassInstance (/Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:12774)
    at updateClassComponent (/Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:14262)
    at beginWork (/Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:15082)
    at performUnitOfWork (/Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:17820)
    at workLoop (/Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:17860)
    at HTMLUnknownElement.callCallback (/Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:149)
    at Object.invokeGuardedCallbackDev (/Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:199)
getDecoratorLength @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/draft-js-plugins-editor/lib/Editor/index.js:65
componentWillReceiveProps @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/draft-js-plugins-editor/lib/Editor/index.js:121
callComponentWillReceiveProps @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:12564
updateClassInstance @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:12774
updateClassComponent @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:14262
beginWork @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:15082
performUnitOfWork @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:17820
workLoop @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:17860
callCallback @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:149
invokeGuardedCallbackDev @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:199
invokeGuardedCallback @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:256
replayUnitOfWork @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:17107
renderRoot @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:17979
performWorkOnRoot @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:18837
performWork @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:18749
performSyncWork @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:18723
requestWork @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:18592
scheduleWork @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:18401
scheduleRootUpdate @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:19069
updateContainerAtExpirationTime @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:19097
updateContainer @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:19154
ReactRoot.render @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:19416
(anonymous) @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:19556
unbatchedUpdates @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:18952
legacyRenderSubtreeIntoContainer @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:19552
render @ /Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:19613
(anonymous) @ index.js:10
./app/index.js @ renderer.dev.js:2324
__webpack_require__ @ bootstrap:724
fn @ bootstrap:101
0 @ only-dev-server.js:105
__webpack_require__ @ bootstrap:724
(anonymous) @ bootstrap:791
(anonymous) @ bootstrap:791
/Users/zhoufan/Documents/electron/SEBrain/node_modules/react-dom/cjs/react-dom.development.js:15749 The above error occurred in the <PluginEditor> component:
    in PluginEditor (at Main/index.js:31)
    in div (created by Context.Consumer)
    in StyledComponent (created by styled.div)
    in MainEditor (at HomePage.js:14)
    in div (created by Context.Consumer)
    in StyledComponent (created by styled.div)
    in HomePage (created by Route)
    in Route (at Routes.js:12)
    in Switch (at Routes.js:10)
    in App (at Routes.js:9)
    in _default (created by Root)
    in Router (created by ConnectedRouter)
    in ConnectedRouter (created by Connect(ConnectedRouter))
    in Connect(ConnectedRouter) (created by Root)
    in Provider (at Root.js:17)
    in Root
    in t (at app/index.js:11)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.