Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

False positive FES warning for loadModel(path, callback)

Open Beginner friendly
#9,295 1 comment 0 reactions 0 assignees View on GitHub

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

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

p5.js 2.0+
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:
  1. Open the p5.js Web Editor.
  2. Upload a valid teapot.obj file into an assets folder in the sketch.
  3. 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
Image
Dominant language
JavaScript
Stars
24.1k
Forks
3.9k
Avg merge
3d 43m
Merged PRs (30d)
33

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from processing/p5.js

All issues in processing/p5.js

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.