Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

SC.stream fails on Firefox, TypeError: t.match(...) is null

Open
#68 8 comments 1 reaction 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from soundcloud/soundcloud-javascript

All issues in soundcloud/soundcloud-javascript

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.