Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server fails when use the https://gh-pinned-repos.egoist.sh/ #9

Closed
joseluisgs opened this issue Aug 5, 2021 · 3 comments
Closed

Server fails when use the https://gh-pinned-repos.egoist.sh/ #9

joseluisgs opened this issue Aug 5, 2021 · 3 comments

Comments

@joseluisgs
Copy link
Contributor

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.

@joseluisgs
Copy link
Contributor Author

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!!!

@joseluisgs
Copy link
Contributor Author

Sometimes there is some projects that GitHub can't detect. I think is better insert try catch options.

@joseluisgs
Copy link
Contributor Author

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

@egoist egoist closed this as completed in b1b2b4e Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant