False positive FES warning for loadModel(path, callback)
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 62/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
调研方向
该警告来自 Friendly Error System 对 loadModel() 的参数检查。请从那里开始,找到将第二个参数期望为字符串的分支。将其与 PR #9286 中的修复进行比较,该修复处理了 loadModel(path, true),并使回调形式通过相同的检查。完成标准是:传入有效回调的 loadModel(path, callback) 不输出任何 FES 警告,并且 loadModel(path, true) 的行为与之前保持一致。
由索引模型根据 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.4
Web browser and version
Google Chrome 155.0.8059.40 (Official Build) (64-bit)
Operating system
Windows 11 Version 25H2 (Build 26200.9457)
Steps to reproduce this
Steps:
- Open the p5.js Web Editor.
- Upload a valid
teapot.objfile into anassetsfolder in the sketch. - Run the following sketch and check the console.
Snippet:
let teapot;
function setup() {
createCanvas(400, 400, WEBGL);
loadModel("/assets/teapot.obj", function (modelData) {
teapot = modelData;
console.log("Model loaded successfully:", modelData);
});
}
function draw() {
background(220);
orbitControl();
normalMaterial();
if (teapot) {
scale(2);
model(teapot);
}
}
Expected behavior
Calling loadModel(path, callback) with a valid callback should not produce a Friendly Error System (FES) warning.
Actual behavior
The model loads and renders successfully, and the callback executes. However, FES reports:
p5.js says: Expected string at the second parameter in loadModel().
This appears to be a false positive because the callback is a valid second argument for this overload.
Additional context
This is a follow-up to Issue #9176 and it's fix PR #9286 , which addressed the false-positive FES warning for loadModel(path, true).
The callback overload loadModel(path, callback) still produces a similar warning after that fix. I reproduced this behavior in the p5.js Web Editor using a local OBJ file.
I'd like to work on this issue if approved. Could a maintainer please review it and assign it to me if appropriate?
Screenshot of Issue Visually
- 主要语言
- JavaScript
- 星标
- 24.1k
- 派生
- 3.9k
- 平均合并
- 3 天 43 分钟
- 30 天内合并 PR
- 33
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
processing/p5.js 的其他 Issue
-
Add unit tests for noiseDetail()可能已有人在做 @harshiltewari2004 于 2 天前认领。 未关闭Area:Math Enhancement
难度 2/5 1-3 小时 新手友好度 75/100
processing/p5.js#9253 · 2 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
[p5.js 2.0+ Bug Report]: storeItem() validation branches are missing `return`, so bad input throws a TypeError or is stored anyway可能已有人在做 @iUjjwalRaj 于 10 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
processing/p5.js#9242 ·
维护者通常 3 天内回复
-
[p5.js 2.0+ Bug Report]: getURLParams() mis-parses valueless parameters and never percent-decodes values可能已有人在做 @mayanksingh-7974 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
processing/p5.js#9241 · 1 条评论 ·
维护者通常 3 天内回复
-
[p5.js 2.0+ Bug Report]: Typo in Spanish reference documentation for ellipseMode()可能重新可做 @cgutierrezval 于 13 天前认领,目前没有进行中的 PR。 未关闭Internationalization p5.js 2.0+
难度 1/5 1 小时以内 新手友好度 95/100
processing/p5.js#9231 · 3 条评论 ·
维护者通常 3 天内回复
-
[p5.js 2.0+ Bug Report]: ReferenceError: p5 is not defined when calling loadPixels/get/copy/mask on p5.MediaElement in ESM可能已有人在做 @Pcmhacker-piro 于 18 天前认领。 未关闭Area:Core Area:DOM
难度 2/5 1-3 小时 新手友好度 86/100
processing/p5.js#9189 · 1 条评论 ·
维护者通常 3 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 82/100
pbakaus/impeccable#1055 ·
维护者通常 1 天内回复
-
Add: EUROTV NEWS未关闭channels:add check:passed
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复