False positive FES warning for loadModel(path, callback)
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- developer-experience
Research direction
The warning comes from the Friendly Error System's argument checks for loadModel(), so start there and find the branch that expects a string as the second parameter. Compare it with the fix in PR #9286, which handled loadModel(path, true), and make the callback form pass the same check. Done when loadModel(path, callback) with a valid callback logs no FES warning, and loadModel(path, true) still behaves as before.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- JavaScript
- Stars
- 24.1k
- Forks
- 3.9k
- Avg merge
- 3d 43m
- Merged PRs (30d)
- 33
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from processing/p5.js
-
Add unit tests for noiseDetail()Possibly taken @harshiltewari2004 claimed this 2 days ago. OpenArea:Math Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
processing/p5.js#9253 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
[p5.js 2.0+ Bug Report]: storeItem() validation branches are missing `return`, so bad input throws a TypeError or is stored anywayPossibly taken @iUjjwalRaj claimed this 9 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
processing/p5.js#9242 ·
Maintainers usually reply within 3 days
-
[p5.js 2.0+ Bug Report]: getURLParams() mis-parses valueless parameters and never percent-decodes valuesPossibly taken @mayanksingh-7974 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
processing/p5.js#9241 · 1 comment ·
Maintainers usually reply within 3 days
-
[p5.js 2.0+ Bug Report]: Typo in Spanish reference documentation for ellipseMode()May be free again @cgutierrezval claimed this 12 days ago, and no pull request is open. OpenInternationalization p5.js 2.0+
Difficulty 1/5 Under an hour Newbie friendliness 95/100
processing/p5.js#9231 · 3 comments ·
Maintainers usually reply within 3 days
-
[p5.js 2.0+ Bug Report]: ReferenceError: p5 is not defined when calling loadPixels/get/copy/mask on p5.MediaElement in ESMPossibly taken @Pcmhacker-piro claimed this 17 days ago. OpenArea:Core Area:DOM
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
processing/p5.js#9189 · 1 comment ·
Maintainers usually reply within 3 days
All issues in processing/p5.js
Similar issues
-
🔧 in development
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mastra-ai/mastra#27210 · 1 comment ·
Maintainers usually reply within 1 day
-
content html
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
prefer-tag-over-role: TypeError propValue.lastIndexOf is not a function on an object-literal role propPossibly taken @thana249 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
jsx-eslint/eslint-plugin-jsx-a11y#1102 ·