Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[p5.js 2.0+ Bug Report] : p5.strands error paths dump internals to console before throwing

Abierto Apto para principiantes
#9,310 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

@subhranshudash13-dotcom ya está trabajando en esto.

Desde el 20/10/2026.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript

Línea de trabajo

Empieza en src/strands/strands_transpiler.js, especialmente en buildStrandsCallback alrededor de las líneas indicadas 2075 y 2099-2101. Reproduce un callback buildMaterialShader mal formado y sigue la salida de la consola antes de cada excepción. El trabajo está terminado cuando los detalles del código fuente interno y del callback ya no se filtren en la consola y el error sea claro; el issue deja abierta la decisión de eliminar los logs o usar el sistema de errores amigables.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Area:WebGL p5.js 2.0+ p5.strands
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:
  1. I was playing around with buildMaterialShader in WEBGL mode and made a typo in my shader callback (still getting the hang of the strands syntax honestly).
  2. Opened devtools to see what went wrong.
  3. 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 before Error 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.

Lenguaje dominante
JavaScript
Estrellas
24.1k
Forks
3.9k
Merge medio
2 d 16 h
PR fusionados (30 d)
34

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de processing/p5.js

Todos los issues de processing/p5.js

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.