SC.stream fails on Firefox, TypeError: t.match(...) is null
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- api
Research direction
Start by reproducing SC.stream on Firefox and inspect the reported function p in https://connect.soundcloud.com/sdk/sdk-3.0.0.js, especially the failing match call. Trace the value passed as t and compare it with other browsers; done means SC.stream handles the Firefox response without this TypeError.
Written by the indexing model from the issue text.
Description
Hi. So I call a basic: SC.stream("/tracks/" + track_id_string).then(handler, errorHandler)
And on Firefox only I get the following error:
TypeError: t.match(...) is null
Stack trace:
p@https://connect.soundcloud.com/sdk/sdk-3.0.0.js:13:23890
f@https://connect.soundcloud.com/sdk/sdk-3.0.0.js:13:23415
r/<@https://connect.soundcloud.com/sdk/sdk-3.0.0.js:18:6074
s@https://connect.soundcloud.com/sdk/sdk-3.0.0.js:18:6310
t.exports</t.exports@https://connect.soundcloud.com/sdk/sdk-3.0.0.js:13:15271
t.exports/<@https://connect.soundcloud.com/sdk/sdk-3.0.0.js:8:18123
R@https://connect.soundcloud.com/sdk/sdk-3.0.0.js:8:2236
N@https://connect.soundcloud.com/sdk/sdk-3.0.0.js:8:2322
x@https://connect.soundcloud.com/sdk/sdk-3.0.0.js:8:2139
m@https://connect.soundcloud.com/sdk/sdk-3.0.0.js:8:759
The error is in this little function:
function p(t) {
if (!t) return 0;
var e = t.match(/\d\S+/)[0].replace(/,/g, ".").split(".");
return parseFloat([e[0], e[1]].join(".")) || 0
}
Error coming from second line. It removes all characters before the first digit in the t string splits the rest by commas. If t = "abc123d,ef" then e = ["123d","ef"]. But you get a type error when there's no digit in the t string.
Not sure why it's only a problem on Firefox. Any ideas?
- Dominant language
- JavaScript
- Stars
- 388
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from soundcloud/soundcloud-javascript
-
Dependency Dashboard Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
soundcloud/soundcloud-javascript#90 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in soundcloud/soundcloud-javascript
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100