Server fails when use the https://gh-pinned-repos.egoist.sh/
joseluisgs opened this issue · comments
Hi
O have his response when I use: https://gh-pinned-repos.egoist.sh/?username=joseluisgs
This Serverless Function has crashed.
Your connection is working correctly.
Vercel is working correctly.
500: INTERNAL_SERVER_ERROR
Code: FUNCTION_INVOCATION_FAILED
ID: cdg1::7znmw-1628181658492-353979fee031
If you are a visitor, contact the website owner or try again later.
If you are the owner, learn how to fix the error and check the logs.
Ok, the fails is here:
const languageColor = $(item)
.find('.repo-language-color')
.css( "background-color" );
Due to:
TypeError: Cannot read property 'attribs' of undefined
at getCss (/Users/link/Proyectos/gh-pinned-repos/node_modules/cheerio/lib/api/css.js:66:25)
at initialize.exports.css (/Users/link/Proyectos/gh-pinned-repos/node_modules/cheerio/lib/api/css.js:22:12)
at Object. (/Users/link/Proyectos/gh-pinned-repos/index.js:34:10)
at initialize.exports.each (/Users/link/Proyectos/gh-pinned-repos/node_modules/cheerio/lib/api/traversing.js:294:24)
at /Users/link/Proyectos/gh-pinned-repos/index.js:17:12
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async module.exports (/Users/link/Proyectos/gh-pinned-repos/index.js:95:14)
I think the problem is due to background color.
I remove language color and everything is ok!!!
Sometimes there is some projects that GitHub can't detect. I think is better insert try catch options.
There is 2 solutions:
1, in the projects without elemento, add in .gitattributes, for exampel language.
2. I make a pull request with try catch to check it and refactor the code if someday any property or css change
#10