Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Chiusa Adatta ai principianti
#9,310 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@subhranshudash13-dotcom ci sta già lavorando.

Dal 20/10/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript

Direzione di ricerca

Inizia da src/strands/strands_transpiler.js, in particolare da buildStrandsCallback intorno alle righe segnalate 2075 e 2099-2101. Riproduci un callback buildMaterialShader malformato e segui l’output della console prima di ogni eccezione. Il lavoro è completato quando i dettagli del sorgente interno e del callback non vengono più divulgati nella console e l’errore è chiaro; l’issue lascia aperta la scelta tra rimuovere i log e usare il sistema di errori intuitivi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
24.2k
Fork
3.9k
Merge medio
2g 14h
PR unite (30g)
35

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di processing/p5.js

Tutte le issue di processing/p5.js

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.