Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#68 コメント 8 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
api

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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?

主要言語
JavaScript
スター
388
フォーク
76
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

soundcloud/soundcloud-javascript のほかの issue

soundcloud/soundcloud-javascript の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。