Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

False positive FES warning for loadModel(path, callback)

Đang mở Phù hợp với người mới
#9,295 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@xsupremeyx đang làm issue này rồi.

Từ ngày 16/10/2026.

  • #9300 của @xsupremeyx — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
62/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
developer-experience

Hướng nghiên cứu

Cảnh báo đến từ các kiểm tra đối số của Friendly Error System cho loadModel(). Hãy bắt đầu từ đó và tìm nhánh mong đợi một chuỗi làm tham số thứ hai. So sánh nó với bản sửa trong PR #9286, bản này xử lý loadModel(path, true), và làm cho dạng có callback vượt qua cùng kiểm tra đó. Hoàn thành khi loadModel(path, callback) với một callback hợp lệ không ghi cảnh báo FES nào, còn loadModel(path, true) vẫn hoạt động như trước.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
JavaScript
Star
24.1k
Fork
3.9k
Merge trung bình
2 ngày 22 giờ
Pull request đã merge (30 ngày)
38

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của processing/p5.js

Tất cả issue của processing/p5.js

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.