gitment icon indicating copy to clipboard operation
gitment copied to clipboard

gitment.js hexo下next主题博客首页面报错,错误信息为gitment.js 16行

Open lixuguang opened this issue 8 years ago • 4 comments
trafficstars

function extendRenderer(instance, renderer) { instance[renderer] = (container) => { const targetContainer = getTargetContainer(container) const render = instance.theme[renderer] || instance.defaultTheme[renderer]

autorun(() => {
  const e = render(instance.state, instance)
  if (targetContainer.firstChild) {
    targetContainer.replaceChild(e, targetContainer.firstChild)
  } else {
    targetContainer.appendChild(e)
  }
})

return targetContainer

} }

mobx.js:1335 [mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: 'Reaction[Autorun@2] TypeError: Cannot read property 'firstChild' of null at gitment.js:16 at reactionRunner (mobx.js:123) at trackDerivedFunction (mobx.js:1000) at Reaction.track (mobx.js:1312) at Reaction.onInvalidate (mobx.js:120) at Reaction.runReaction (mobx.js:1288) at runReactionsHelper (mobx.js:1404) at reactionScheduler (mobx.js:1386) at runReactions (mobx.js:1390) at Reaction.schedule (mobx.js:1276) Reaction.reportExceptionInDerivation @ mobx.js:1335 Reaction.track @ mobx.js:1319 (anonymous) @ mobx.js:120 Reaction.runReaction @ mobx.js:1288 runReactionsHelper @ mobx.js:1404 reactionScheduler @ mobx.js:1386 runReactions @ mobx.js:1390 Reaction.schedule @ mobx.js:1276 autorun @ mobx.js:125 instance.(anonymous function) @ gitment.js:14 (anonymous) @ (index):1549

lixuguang avatar Oct 12 '17 02:10 lixuguang

我也遇到这个问题,解决了吗

ljinkai avatar Oct 18 '17 11:10 ljinkai

没有,最近没再看

lixuguang avatar Nov 03 '17 08:11 lixuguang

你需要在你的页面 创建一个div(评论控件的位置) id 为初始化的 gitment.render('comments') 比如

<div id='comments'></div> 

Jiachang-Cai avatar May 12 '18 22:05 Jiachang-Cai

https://advance-esthetic.us/rf-facial-machines

sariabiha avatar Feb 11 '22 11:02 sariabiha