imsun / gitment

A comment system based on GitHub Issues.
https://imsun.github.io/gitment/
MIT License
4.06k stars 350 forks source link

初始化出现 Error: Not Found #18

Closed xiaohao890809 closed 7 years ago

xiaohao890809 commented 7 years ago

初始化出现 Error: Not Found,无法评论 另外,火狐浏览器无法显示评论框

opengit commented 7 years ago

我也遇到这个问题了

xiaohao890809 commented 7 years ago

@opengit 你的repo咋填的呢?我怀疑我的填错了

s2117402 commented 7 years ago

好像是就写repo地址就可以,比如comments

ryancui92 commented 7 years ago

@s2117402 直接写 repo 地址并不可以

s2117402 commented 7 years ago

@ryancui- 说错了,是repo的名字。改成这样后至少不是Error: Not Found了

s2117402 commented 7 years ago

@ryancui- 然后我后来出的问题是按log in就转跳到个人主页的首页,我重新部署了下我的主页就解决了

zo-ly commented 7 years ago

@s2117402 重新部署主页是什么意思,具体怎么操作

tiexo commented 7 years ago

我也遇到这个了,究竟咋解决啊

imsun commented 7 years ago

很大可能是 repo 名字填错了。以这个项目为例,owner 应该填 imsun,repo 应该填 gitment

如果还是不对请贴配置代码。

opengit commented 7 years ago

@tiexo 看看 @imsun 的解决办法,就是这样解决的。

qkmaosjtu commented 7 years ago

@opengit 我的保证是reo的名字,但是还是出现了这样的错误,怎么可以冲洗初始化呢?

opengit commented 7 years ago

@qkmaosjtu 我的是在每篇博文下面,就出现一个初始化按钮,点击一下就初始化了。以后每篇新的博文,都需要自己取初始化一下。

ryancui92 commented 7 years ago

@qkmaosjtu 和 @opengit 一样,有个初始化按钮。但两星期前部署的时候,我也遇到这个问题,当时的参数(repo)都没有填错,最近试了一次突然又好了。。

ghost commented 7 years ago

我的已经按照教程搞了,GitHub的repo也是对的,为什么还会出问题,无法初始化

opengit commented 7 years ago

@wuhang2003 repo 直接填写名字就行了

shadowquark commented 7 years ago

似乎 repo 不能是 private 的。一開始我設成了 private 的,也收到了相同的錯誤信息。

zouliming commented 7 years ago

请问博主,这个评论插件只能在Hexo上用,对吗?Wordpress不能用?

mosdeo commented 7 years ago

repo 名稱改正確後可以 initialize,但是一按 initialize 就出現 Error: Validation Failed

celesteting commented 7 years ago

控制台会报这个错 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)

eleztian commented 7 years ago

@s2117402 老铁,我也这样了,怎么搞!

anson2416 commented 7 years ago

我遇到这个问题,有无人知道怎样解决?

Error: Comments Not Initialized

我的配置系:

gitment:
  enable: true
  githubID: anson2416
  repo: anson2416.github.io
  ClientID: 111
  ClientSecret: 111
  lazy: true
stven0king commented 7 years ago

@anson2416 Error: Comments Not Initialized出现这个之后点击login然后回到这个页面有一个Initialize的按钮,点击之后就可以评论了。

opengit commented 7 years ago

@anson2416 repo: anson2416.github.io这里直接写repo: anson2416试试

hhsyy commented 6 years ago

写成这样就好了hhsyy.github.io

ronniesir commented 6 years ago

我的还是不行

rayeden commented 6 years ago

咳,终于弄好了。我只想说,记得把这个仓库设置成public,否则当然是404了。 --------------- 割 --------------------- 折腾一下午拉,还是NOT FOUND,是不是和我配置了域名有关? 抓包抓出来是这个 Request URL:https://api.github.com/repos/rayeden/rayeden.github.io/issues?creator=rayeden&labels=%2F2017%2F12%2F27%2FgitmentTest%2F Request Method:GET Status Code:404 Not Found Remote Address:127.0.0.1:8888 Referrer Policy:no-referrer-when-downgrade

DouMiaoO-Oo commented 6 years ago

我通过在浏览器输入 https://api.github.com/users/你的账户名 得到了id,但是还是error not found。后来改用了填入账户名就成功了。

benjaminwhx commented 6 years ago

gitment: owner: benjaminwhx repo: # 自己新建的仓库 client_id: # your client id client_secret: # your client secret

repo这个参数很重要,你要在自己的github里面新建一个仓库,这个仓库是用来记录别人提出的issue,也就是回复内容的。例如imsun作者它要配置repo,就得输入gitment,因为这是它的仓库名。

owner这个不要相信上面说的填写id,而是你自己的用户名,https://github.com/owner能够打开你自己的仓库才对

jdhao commented 6 years ago

If you use NexT latest theme, a sample configuration that works for me is follows:

gitment:
  enable: enable
  mint: true # RECOMMEND, A mint on Gitment, to support count, language and proxy_gateway
  count: true # Show comments count in post meta area
  lazy: false # Comments lazy loading with a button
  cleanly: false # Hide 'Powered by ...' on footer, and more
  language: en
  github_user: jdhao
  github_repo: jdhao.github.io #the name of the repo used to host your blog
  client_id: xxxxxxx # your Client ID
  client_secret: xxxxxx # your Client Secret
  proxy_gateway: # Address of api proxy, See: https://github.com/aimingoo/intersect
  redirect_protocol: # Protocol of redirect_uri with force_redirect_protocol when mint enabled

Also, if this is your first time to comment some post. After login, you need to click the button Initialize Comments above the comment box. image

Then you can comment successfully.

yuanwenjian commented 6 years ago

我的not found 找到原因, 查看生成的html的源码,发现owenr 与repo取值为空

function showGitment() {
    $("#gitment_title").attr("style", "display:none");
    $("#container").attr("style", "").addClass("gitment_container");
    var gitment = new Gitment({
      id: window.location.pathname,
      theme: myTheme,
      owner: '',
      repo: '',
      oauth: {
        client_id: '21bb0ade****',
        client_secret: '903e69fae75a**'
      }
    });
    gitment.render('container');
  }

解决办法: 在~blog/themes/next/layout/_partials/comments.swig 文件中手动添加owner与repo

function showGitment() {
    $("#gitment_title").attr("style", "display:none");
    $("#container").attr("style", "").addClass("gitment_container");
    var gitment = new Gitment({
      id: window.location.pathname,
      theme: myTheme,
      owner: "owner", //github用户
      repo: "repo",  //repo
      oauth: {
        client_id: '{{ theme.gitment.client_id }}',
        client_secret: '{{ theme.gitment.client_secret }}'
      }
    });
    gitment.render('container');

希望能帮到有同样问题的老铁

Hoooxz commented 6 years ago

repo填写的应该是新建的用于存储评论的仓库名,比如说我新建的仓库名为gitment-comments,填入gitment-comments即可。我是在控制台里看AJAX时发现对Request URL:https://api.github.com/repos/hoooxz/…… 请求时返回了404,才意识到这个问题的~

llccing commented 6 years ago

我在本地调试时时有问题的,但是部署之后 hexo d ,GitHub验证一下就没有问题了。

sunms1024 commented 5 years ago

我也遇到这个问题了

repo要新建...

sunms1024 commented 5 years ago

终极答案 repo不是填你新建的oauth 是要新建一个repo用这个repo的issue去承载你的评论

puddlejumper26 commented 5 years ago

我的一直出现问题:

gitment:
  enable: true
  mint: true # RECOMMEND, A mint on Gitment, to support count, language and proxy_gateway
  count: true # Show comments count in post meta area
  lazy: false # Comments lazy loading with a button
  cleanly: false # Hide 'Powered by ...' on footer, and more
  language: english # Force language, or auto switch by theme
  github_user: puddlejumper26
  github_repo: comments-gitment
  client_id: '3e625394d55d8b160bb4'
  client_secret: '7e22a4c661b262844e292b60124104ccb44e9641'

运行 hexo d 刷新页面 页面显示 Error: Comments Not Initialized 点击Login,然后跳出对话框 [object ProgressEvent] 点击确定之后Gitment的地方就一直显示在Logging in,不能操作

之前的办法都看了也试了,用不同的浏览器,注册了新的repo,重新注册oAuth,都不行,

求大神帮忙解决一下

wnxy commented 5 years ago

我的一直出现问题:

gitment:
  enable: true
  mint: true # RECOMMEND, A mint on Gitment, to support count, language and proxy_gateway
  count: true # Show comments count in post meta area
  lazy: false # Comments lazy loading with a button
  cleanly: false # Hide 'Powered by ...' on footer, and more
  language: english # Force language, or auto switch by theme
  github_user: puddlejumper26
  github_repo: comments-gitment
  client_id: '3e625394d55d8b160bb4'
  client_secret: '7e22a4c661b262844e292b60124104ccb44e9641'

运行 hexo d 刷新页面 页面显示 Error: Comments Not Initialized 点击Login,然后跳出对话框 [object ProgressEvent] 点击确定之后Gitment的地方就一直显示在Logging in,不能操作

之前的办法都看了也试了,用不同的浏览器,注册了新的repo,重新注册oAuth,都不行,

求大神帮忙解决一下 我的也是同样的问题,一直“正在登录...”,我想问一下大哥你的解决了没有

puddlejumper26 commented 5 years ago

还是没有解决,都想换插件了

xiaobinwu commented 5 years ago

我也是

Amorness commented 5 years ago
ActingCute commented 5 years ago

坑 Error: Comments Not Initialized

ghost commented 5 years ago

~文章标题不要有空格,即可解决~

标题包含中英文时,不能有空格。

KevinYuKun commented 5 years ago

gitub_user 记得填你github的用户名,github_repo才是填仓库名。 可以用https://api.github.com/repos/{owner}/{repo}这个来测试一下你的地址是否正确

chufusheng commented 4 years ago

11