SC.stream fails on Firefox, TypeError: t.match(...) is null
还没有人认领这个 Issue。
评估
- 难度
- 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
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
soundcloud/soundcloud-javascript 的其他 Issue
-
难度 5/5 一周以上 新手友好度 15/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 15/100
-
难度 3/5 1-2 天 新手友好度 45/100
soundcloud/soundcloud-javascript#90 · 1 个 reaction ·
-
难度 5/5 一周以上 新手友好度 25/100
查看 soundcloud/soundcloud-javascript 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
swc-project/swc#12516 ·
维护者通常 1 天内回复
-
feature-request
难度 2/5 1-3 小时 新手友好度 72/100
omegaup/omegaup#10323 · 1 条评论 ·
维护者通常 5 天内回复
-
area/frontend good first issue kind/cooldown
难度 2/5 1-3 小时 新手友好度 78/100
kestra-io/kestra#20702 · 1 条评论 ·
维护者通常 1 天内回复
-
Form-data fields are not parsed when importing a cURL request可能已有人在做 @aayushbaluni 今天认领。 未关闭bug status-new
难度 2/5 1-3 小时 新手友好度 69/100
维护者通常 1 天内回复
-
bug MVP
难度 2/5 1-3 小时 新手友好度 68/100
saayam-for-all/webapp#1911 ·
维护者通常 1 天内回复