每当我单击Markdown文件中的某些单词时,控制台中的Atom Markdown编辑器中都会出现以下错误

Uncaught TypeError: Cannot read property 'lineHeight' of null marker-view.coffee:23
module.exports.MarkerView.appendRegion marker-view.coffee:23
MarkerView marker-view.coffee:15
module.exports.HighlightedAreaView.handleSelection highlighted-area-view.coffee:65
(anonymous function) highlighted-area-view.coffee:1
jQuery.event.dispatch /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4360
jQuery.event.trigger /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4594
(anonymous function) /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5119
jQuery.extend.each /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:590
jQuery.fn.jQuery.each /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:237
jQuery.fn.extend.trigger /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5118
$.fn.trigger main.coffee:31
module.exports.React.createClass.componentDidUpdate /Applications/Atom.app/Contents/Resources/app/src/editor-component.js:269
mixInto.notifyAll /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactMountReady.js:69
ON_DOM_READY_QUEUEING.close /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactReconcileTransa…:87
Mixin.closeAll /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:242
Mixin.perform /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:175
ReactComponent.Mixin.performUpdateIfNecessary /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactComponent.js:478
ReactCompositeComponentMixin.performUpdateIfNecessary /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactCompositeCompon…:1157
runBatchedUpdates /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactUpdates.js:66
(anonymous function) /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactUpdates.js:86
Mixin.closeAll /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:242
Mixin.perform /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:175
ReactDefaultBatchingStrategy.batchedUpdates /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactDefaultBatching…:70
batchedUpdates /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactUpdates.js:35
ReactEventEmitterMixin.handleTopLevel /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactEventEmitterMix…:53
handleTopLevelImpl /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactEventTopLevelCa…:81
(anonymous function) /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactEventTopLevelCa…:140


我该如何解决这个错误?

最佳答案

这是一个空引用错误。您正在对null的对象调用lineHeight。

10-07 13:32