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

Using layout parameter twice in top-langs gives toLowerCase not a function error #2737

Closed
feikname opened this issue May 19, 2023 · 3 comments

Comments

@feikname
Copy link

feikname commented May 19, 2023

EDIT: I was giving two layout parameters without noticing, ignore the PR reference! Nonetheless here's the bug report

If layout parameter is given two times such as in https://github-readme-stats.vercel.app/api/top-langs/?username=feikname&layout=compact&layout=compact

Then this happens

image

@feikname feikname changed the title Using layout parameter in top-langs gives toLowerCase not a function error Using layout parameter twice in top-langs gives toLowerCase not a function error May 19, 2023
@qwerty541
Copy link
Collaborator

qwerty541 commented May 19, 2023

Remove extra layout parameter then. I'm not sure that it is a bug. What do you think @rickstaa ?

If we are going to fix it the source of problem is the following code string:

} else if (layout?.toLowerCase() === "donut") {

UPD: according to docs layout parameter expected to be a string, when you submit it several times it become an array. Now i`m sure that this problem is not on our side. This issue should be closed. The one thing that we can do is to show more user friendly error in case of types mismatch.

rickstaa added a commit that referenced this issue May 24, 2023
This commit makes sure that the `layout?.toLowerCase is not a function` error is not
thrown when users accidentally supply two layouts (see #2737)
@rickstaa
Copy link
Collaborator

@feikname thanks for your bug report. I fixed the issues your having in #2746.

@rickstaa rickstaa linked a pull request May 24, 2023 that will close this issue
@rickstaa
Copy link
Collaborator

rickstaa commented Jun 5, 2023

Fixed in #2770.

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

Successfully merging a pull request may close this issue.

3 participants