[p5.js 2.0+ Bug Report] : p5.strands error paths dump internals to console before throwing
维护者通常 3 天内回复
@subhranshudash13-dotcom 已经在做这个了。
开始于 2026年10月20日。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
调研方向
从src/strands/strands_transpiler.js开始,重点查看报告中第2075行和2099-2101行附近的buildStrandsCallback。复现格式错误的buildMaterialShader回调,并追踪每次抛出异常前的控制台输出。当内部源码和回调细节不再泄露到控制台且错误信息清晰时,即完成;issue未决定是删除日志还是使用友好的错误系统。
由索引模型根据 Issue 内容生成。
描述
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- WebGPU
- p5.strands
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.3.2 / current main
Web browser and version
Chromium 151
Operating system
MacOS 15.7
Steps to reproduce this
Steps:
- I was playing around with
buildMaterialShaderin WEBGL mode and made a typo in my shader callback (still getting the hang of the strands syntax honestly). - Opened devtools to see what went wrong.
- Instead of one clear error, the console first printed a big dump of generated source code, and only then threw
Could not parse p5.strands function!. On a different malformed shape I also saw param names and the full body logged beforeError transpiling p5.strands callback!.
Snippet:
function setup() {
createCanvas(200, 200, WEBGL);
// my callback had a typo in it, wanted to see the error
let s = buildMaterialShader(() => {
// malformed shape here
});
}
What I expected: a single friendly error pointing at what I got wrong in my callback.
What actually happened: internals dumped to the console first via console.log, then the generic throw. I ended up digging through generated code instead of fixing my typo, which was pretty confusing as someone new to shaders.
Where I traced it: src/strands/strands_transpiler.js in buildStrandsCallback, line 2075 (console.log(escodegen.generate(ast))) and lines 2099-2101 (console.error(e); console.log(paramNames); console.log(body)).
One question —
would you prefer these just removed, or routed through the friendly error system with the source location that's already available..?
Happy to follow this approach and happy to go your direction if you think something else fits better here.
- 主要语言
- JavaScript
- 星标
- 24.2k
- 派生
- 3.9k
- 平均合并
- 3 天 2 小时
- 30 天内合并 PR
- 35
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
processing/p5.js 的其他 Issue
-
Area:Core p5.js 2.0+
难度 2/5 1-3 小时 新手友好度 66/100
processing/p5.js#9319 · 1 条评论 ·
维护者通常 3 天内回复
-
Area:WebGL p5.js 2.0+ p5.strands
难度 2/5 1-3 小时 新手友好度 68/100
processing/p5.js#9317 · 1 条评论 ·
维护者通常 3 天内回复
-
Area:DOM Good First Issue p5.js 2.0+
难度 2/5 1-3 小时 新手友好度 76/100
processing/p5.js#9316 · 1 条评论 · 1 个 reaction ·
维护者通常 3 天内回复
-
[p5.js 2.0+ Bug Report]: touches[0].x lags one pointer event behind while dragging可能已有人在做 @titanstride 于 5 天前认领。 未关闭Area:Events p5.js 2.0+
难度 2/5 1-3 小时 新手友好度 76/100
processing/p5.js#9305 · 1 条评论 ·
维护者通常 3 天内回复
-
loadModel() options break without fileType and ignore flipU/flipV可能已有人在做 @saniyaa-17 于 5 天前认领。 未关闭Area:WebGL p5.js 2.0+
难度 2/5 1-3 小时 新手友好度 78/100
processing/p5.js#9302 · 2 条评论 ·
维护者通常 3 天内回复
相似的 Issue
-
建议增加URL参数构建的工具未关闭
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 67/100
uoftblueprint/canada-basketball#67 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 61/100
Fei2411/DeepSeek-Bot#456 ·
维护者通常 1 天内回复
-
área:app área:produto sem-fase tipo:decisão
难度 2/5 1-3 小时 新手友好度 63/100
Varanda-org/varanda#91 ·
-
0️⃣ phase/new
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复