github-cards icon indicating copy to clipboard operation
github-cards copied to clipboard

sometimes not showing cards

Open edap opened this issue 8 years ago • 27 comments

Hey, I'm using your widget but since some days I've this error: screen shot 2017-05-16 at 08 53 44

The page where I'm loading your widget is: http://davideprati.com/tools

When showing just one card there is no problem, when showing 6 I've this behaviour. This error happens randomly, it is not alway reproducible

edap avatar May 16 '17 06:05 edap

I've refreshed the page > 20 times. Nothing happened.

lepture avatar May 16 '17 07:05 lepture

well, it was working when I've installed it. Is it possible that there is a maximal number of cards that you can show in a page?

edap avatar May 16 '17 07:05 edap

No.

lepture avatar May 16 '17 07:05 lepture

Sorry, but I do not get your approach. Do you think it is a bug or an error in how I've installed your library?

edap avatar May 16 '17 08:05 edap

I think that the problem is that your script is making a request for a single repository and then format it. But it probably should make the requests for all the repository, and then, when all of them have a response, render them. Something like "Promise.all" should do the job. Otherwise, you could get all the repository for a single user and then filter them

edap avatar May 16 '17 09:05 edap

I can confirm that it works with 4 cards but it is broken with 6

edap avatar May 18 '17 08:05 edap

possibly somewhat related but this seems to have been completely broken for all cards. it looks like the cdn provided, jsdelivr, is sending back the wrong content type: capture

darrenbritton avatar May 18 '17 23:05 darrenbritton

@edap download the script and put it locally. Worked fine for me. CDN version seems to be broken

yury-dymov avatar May 19 '17 17:05 yury-dymov

@yury-dymov it is still not working, also when the script is in local http://davideprati.com/tools. It was working yesterday.

edap avatar May 23 '17 15:05 edap

works fine for me: https://dymov.me/ btw, I opened your site and it also worked fine for me.

yury-dymov avatar May 23 '17 16:05 yury-dymov

@yury-dymov it really shouldn't, are you sure you're not operating from local cache? screen shot 2017-05-23 at 17 25 41

darrenbritton avatar May 23 '17 16:05 darrenbritton

It is still not working, and in your website is also not working

screen shot 2017-05-23 at 18 25 48

edap avatar May 23 '17 16:05 edap

oh, shi... Probably I am done using this package

update: editing local widget.js should be easy: var t="http://lab.lepture.com/github-cards/ -> var t="https://lab.lepture.com/github-cards/ but I don't like idea to use 3d party service like that

yury-dymov avatar May 23 '17 16:05 yury-dymov

i managed to get it working (hopefully as a temporary solution) by just including the iframe directly, inspect the bottom of this page to see https://darrenbritton.com/

darrenbritton avatar May 23 '17 16:05 darrenbritton

Got the same problem, apparently it is uBlock that is preventing execution, as per this issue: https://github.com/gorhill/uBlock/issues/2029

Maybe the architecture should be rethought?

augnustin avatar Jun 09 '17 10:06 augnustin

New version released.

lepture avatar Jun 12 '17 02:06 lepture

Still failing at https://atd.singularities.org with 8 cards

https://cdn.jsdelivr.net/github-cards/latest/widget.js seems to deliver previous version:

(function(e){var t="//cdn.jsdelivr.net/github-cards/1.0.2/" .....

atd avatar Jun 27 '17 11:06 atd

@atd if your website is hosted on github, you have access to all your repository without making an API call to github. I've used the css style provided by this repository but I've created a template (in liquid template language) to fetch the repos. https://github.com/edap/edap.github.com/blob/master/_includes/card.html I do not know if this is your case

edap avatar Jun 27 '17 12:06 edap

No, my website is self-hosted. Are there any API call restrictions involved?

atd avatar Jun 27 '17 12:06 atd

Some users where reporting it was with the CDN, I did not investigate

edap avatar Jun 27 '17 12:06 edap

@edap and @atd, I think it has to do with the CDN in jsDelivr. I opened up and issue #48 and while investigating found that it's probably the CDN.

@edap, I saw your site, how/why are your cards rendering? Did you use that template mentioned above?

bretonics avatar Jul 17 '17 15:07 bretonics

I'm using jekyll hosted on github, there is a global variable with all the repositories. If you are interested, have a look at https://github.com/edap/edap.github.com/blob/master/tools.html

edap avatar Jul 17 '17 16:07 edap

It's due to jsdelivr CDN changes.

lepture avatar Jul 18 '17 02:07 lepture

I'm looking for solution too. https://github.com/jsdelivr/jsdelivr/issues/18027 This issue can be reproduced by using an old version of github-card. Example

laike9m avatar Jul 30 '17 15:07 laike9m

jsDelivr no longer supports serving files with Content-Type: text/html for security reasons, but this change probably shouldn't have been applied to existing files. We've just pushed a fix to remove this restriction for existing files. If you keep getting a cached copy with Content-Type: text/plain, you can ping our bot here to purge the CDN cache. Sorry for the caused problems.

MartinKolarik avatar Jul 30 '17 17:07 MartinKolarik

@jsdelivrbot purge https://cdn.jsdelivr.net/zhihu-card/0.2.3/theme/github.html

MartinKolarik avatar Jul 30 '17 17:07 MartinKolarik

I purged this file "/zhihu-card/0.2.3/theme/github.html" from MaxCDN, CloudFlare, Fastly and Quantil.

jsdelivrbot avatar Jul 30 '17 17:07 jsdelivrbot