Shields: Badge suggestion feature not working

Created on 18 Feb 2019  路  13Comments  路  Source: badges/shields

Are you experiencing an issue with...

  • [x] [shields.io](https://shields.io/#/)

:beetle: Description

Entering e.g. http://example.com into the suggest box and clicking Suggest badges throws an exception and generates this stack trace:

Uncaught (in promise) TypeError: Cannot read property 'replace' of undefined
    at n (make-badge-url.js:53)
    at Array.map (<anonymous>)
    at staticBadgeUrl (make-badge-url.js:65)
    at a.r.renderExample (badge-examples.js:41)
    at badge-examples.js:90
    at Array.map (<anonymous>)
    at a.r.render (badge-examples.js:90)
    at Ri (react-dom.production.min.js:169)
    at Ci (react-dom.production.min.js:168)
    at Li (react-dom.production.min.js:176)
bug frontend

Most helpful comment

I will fix this bug :-)

All 13 comments

Sidenote, I never really knew the Suggest badges feature even existed 馃槃 I feel like I'd read mentions of it before but it never really resonated til now

It's not very discoverable, is it?

It's almost like an easter egg!

Still same error
screenshot from 2019-03-01 14-17-40

This still appears to be happening from what I can see...

Yup, the problem with the suggestion feature still exists and is being tracked here.

Once the suggestion feature has been fixed, we will close this issue.

If you're experiencing this issue too, feel free to 馃憤 the top post. That's what those are for :)

After fixing this bug end-to-end tests (introduced in https://github.com/badges/shields/pull/3262) can be used to test badge suggestion feature :-).

i'm facing this issue again.

react-dom.production.min.js:198 TypeError: Cannot read property 'replace' of undefined
    at o (make-badge-url.js:53)
    at Array.map (<anonymous>)
    at staticBadgeUrl (make-badge-url.js:65)
    at A (badge-examples.js:37)
    at Xo (react-dom.production.min.js:150)
    at Mi (react-dom.production.min.js:178)
    at $a (react-dom.production.min.js:232)
    at Ka (react-dom.production.min.js:233)
    at Ol (react-dom.production.min.js:249)
    at Cl (react-dom.production.min.js:248)
da @ react-dom.production.min.js:198
i.componentDidCatch.n.callback @ react-dom.production.min.js:211
oa @ react-dom.production.min.js:193
ra @ react-dom.production.min.js:193
Ba @ react-dom.production.min.js:216
Va @ react-dom.production.min.js:220
(anonymous) @ react-dom.production.min.js:250
t.unstable_runWithPriority @ scheduler.production.min.js:18
Nl @ react-dom.production.min.js:250
Ol @ react-dom.production.min.js:249
Cl @ react-dom.production.min.js:248
Sl @ react-dom.production.min.js:245
Ja @ react-dom.production.min.js:243
enqueueSetState @ react-dom.production.min.js:130
x.setState @ react.production.min.js:13
(anonymous) @ suggestion-and-search.js:58
C @ runtime.js:62
(anonymous) @ runtime.js:288
e.(anonymous function) @ runtime.js:114
n @ asyncToGenerator.js:3
u @ asyncToGenerator.js:25
Promise.then (async)
n @ asyncToGenerator.js:13
u @ asyncToGenerator.js:25
Promise.then (async)
n @ asyncToGenerator.js:13
u @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
oa @ react-dom.production.min.js:193
ra @ react-dom.production.min.js:193
Ba @ react-dom.production.min.js:216
Va @ react-dom.production.min.js:220
(anonymous) @ react-dom.production.min.js:250
t.unstable_runWithPriority @ scheduler.production.min.js:18
Nl @ react-dom.production.min.js:250
Ol @ react-dom.production.min.js:249
Cl @ react-dom.production.min.js:248
Ul @ react-dom.production.min.js:251
Pn @ react-dom.production.min.js:85
react-dom.production.min.js:198 TypeError: Cannot read property 'replace' of undefined
    at o (make-badge-url.js:53)
    at Array.map (<anonymous>)
    at staticBadgeUrl (make-badge-url.js:65)
    at A (badge-examples.js:37)
    at Xo (react-dom.production.min.js:150)
    at Mi (react-dom.production.min.js:178)
    at $a (react-dom.production.min.js:232)
    at Ka (react-dom.production.min.js:233)
    at Ol (react-dom.production.min.js:249)
    at Cl (react-dom.production.min.js:248)
da @ react-dom.production.min.js:198
n.callback @ react-dom.production.min.js:210
oa @ react-dom.production.min.js:193
ra @ react-dom.production.min.js:193
Ba @ react-dom.production.min.js:217
Va @ react-dom.production.min.js:220
(anonymous) @ react-dom.production.min.js:250
t.unstable_runWithPriority @ scheduler.production.min.js:18
Nl @ react-dom.production.min.js:250
Ol @ react-dom.production.min.js:249
Cl @ react-dom.production.min.js:248
Sl @ react-dom.production.min.js:245
Ja @ react-dom.production.min.js:243
enqueueSetState @ react-dom.production.min.js:130
x.setState @ react.production.min.js:13
(anonymous) @ suggestion-and-search.js:58
C @ runtime.js:62
(anonymous) @ runtime.js:288
e.(anonymous function) @ runtime.js:114
n @ asyncToGenerator.js:3
u @ asyncToGenerator.js:25
Promise.then (async)
n @ asyncToGenerator.js:13
u @ asyncToGenerator.js:25
Promise.then (async)
n @ asyncToGenerator.js:13
u @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
oa @ react-dom.production.min.js:193
ra @ react-dom.production.min.js:193
Ba @ react-dom.production.min.js:216
Va @ react-dom.production.min.js:220
(anonymous) @ react-dom.production.min.js:250
t.unstable_runWithPriority @ scheduler.production.min.js:18
Nl @ react-dom.production.min.js:250
Ol @ react-dom.production.min.js:249
Cl @ react-dom.production.min.js:248
Ul @ react-dom.production.min.js:251
Pn @ react-dom.production.min.js:85
asyncToGenerator.js:6 Uncaught (in promise) TypeError: Cannot read property 'replace' of undefined
    at o (make-badge-url.js:53)
    at Array.map (<anonymous>)
    at staticBadgeUrl (make-badge-url.js:65)
    at A (badge-examples.js:37)
    at Xo (react-dom.production.min.js:150)
    at Mi (react-dom.production.min.js:178)
    at $a (react-dom.production.min.js:232)
    at Ka (react-dom.production.min.js:233)
    at Ol (react-dom.production.min.js:249)
    at Cl (react-dom.production.min.js:248)
o @ make-badge-url.js:53
staticBadgeUrl @ make-badge-url.js:65
A @ badge-examples.js:37
Xo @ react-dom.production.min.js:150
Mi @ react-dom.production.min.js:178
$a @ react-dom.production.min.js:232
Ka @ react-dom.production.min.js:233
Ol @ react-dom.production.min.js:249
Cl @ react-dom.production.min.js:248
Sl @ react-dom.production.min.js:245
Ja @ react-dom.production.min.js:243
enqueueSetState @ react-dom.production.min.js:130
x.setState @ react.production.min.js:13
(anonymous) @ suggestion-and-search.js:58
C @ runtime.js:62
(anonymous) @ runtime.js:288
e.(anonymous function) @ runtime.js:114
n @ asyncToGenerator.js:3
u @ asyncToGenerator.js:25
Promise.then (async)
n @ asyncToGenerator.js:13
u @ asyncToGenerator.js:25
Promise.then (async)
n @ asyncToGenerator.js:13
u @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
oa @ react-dom.production.min.js:193
ra @ react-dom.production.min.js:193
Ba @ react-dom.production.min.js:216
Va @ react-dom.production.min.js:220
(anonymous) @ react-dom.production.min.js:250
t.unstable_runWithPriority @ scheduler.production.min.js:18
Nl @ react-dom.production.min.js:250
Ol @ react-dom.production.min.js:249
Cl @ react-dom.production.min.js:248
Ul @ react-dom.production.min.js:251
Pn @ react-dom.production.min.js:85

I will fix this bug :-)

Hey @platan did you make any progress with this? I was working on #2679. Want me to have a look at this, while I'm at it?

I was going to create a PR tomorrow, but I can do it today. Just give me 10 minutes.

This is fixed! Thank you @platan! 馃檶

Was this page helpful?
0 / 5 - 0 ratings

Related issues

korenyoni picture korenyoni  路  3Comments

PyvesB picture PyvesB  路  3Comments

rominf picture rominf  路  3Comments

Fazendaaa picture Fazendaaa  路  3Comments

niccokunzmann picture niccokunzmann  路  3Comments