Renamed `sketch.js` still executes when referenced in `index.html` (caching issue?)
I maintainer di solito rispondono entro 3 giorni
@SinhaS12 ci sta già lavorando.
Dal 2/12/2025.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- web-dev
Direzione di ricerca
Inizia dallo sketch collegato e ispeziona i riferimenti a sketch.js e not.js in index.html, insieme a loadStrings("sketch.js") da not.js. Riproduci il comportamento dei file obsoleti e traccia il modo in cui l'anteprima risolve i file rinominati; il lavoro è completo quando i file rimossi o rinominati non vengono più eseguiti o restituiti e i riferimenti mancanti falliscono.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
p5.js version
2.1.1
What is your operating system?
Mac OS
Web browser and version
Chrome Version 142.0.7444.176 (Official Build) (arm64)
Actual Behavior
In the p5 web editor (p5.js 2.1.1) I am seeing cases where an old version of sketch.js keeps being executed or loaded even after the file has been renamed (for example to not.js).
In those cases:
- Changing
<script src="not.js">to<script src="sketch.js">makes the preview run an older version of the code, even thoughsketch.jsno longer exists in the Sketch Files panel. - This still happens when loading the same project in an incognito window, so it does not look like a simple browser cache issue.
Expected Behavior
- If
sketch.jshas been renamed or removed, referencing it inindex.htmlor vialoadStrings("sketch.js")should fail, not load a stale copy. - The preview should only execute and load files that exist in the Sketch Files panel.
Steps to reproduce
I have not yet found a reliable series of steps to reproduce from a fresh sketch, but the problem started in a sketch where await loadStrings("sketch.js") was used and the file was later renamed. I'm not sure whether that is significant.
Here is a sketch exhibiting that behavior: https://editor.p5js.org/SableRaf/sketches/wuZkibCGu
Try changing <script src="sketch.js"></script> to <script src="not.js"></script> and see the color change.
Additionally, when calling loadStrings("sketch.js") from not.js, the console output shows the old contents of sketch.js from before the file was renamed to not.js (see screenshot below). The file sketch.js no longer exists in the Sketch Files panel, yet loadStrings("sketch.js") still returns the previous version instead of failing.
- Lingua principale
- JavaScript
- Stelle
- 1.7k
- Fork
- 1.7k
- Merge medio
- 3g 18h
- PR unite (30g)
- 7
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di processing/p5.js-web-editor
-
`PATCH /editor/project/visibility` returns 200 with `null` and doesn't update when `projectId` is a slugForse già presa @Prbhtsgh l’ha presa oggi. ApertaAwaiting Maintainer Approval Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
processing/p5.js-web-editor#4348 · 3 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
Fix: example.js stores defaultHTML function reference instead of calling it, causing examples to display raw JavaScript source in previewForse già presa @syedbarkath980 l’ha presa 5 giorni fa. ApertaAwaiting Maintainer Approval Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
processing/p5.js-web-editor#4344 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
signup form gets stuck when signup request fails due to network errorForse già presa @PS01K l’ha presa 34 giorni fa. ApertaAwaiting Maintainer Approval Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
processing/p5.js-web-editor#4285 · 3 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
saveProject throws an error when a network request failsForse già presa @dyk1454683243-sudo l’ha presa 6 giorni fa. ApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
processing/p5.js-web-editor#4276 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
Awaiting Maintainer Approval Enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
processing/p5.js-web-editor#4270 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di processing/p5.js-web-editor
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
`yarn vitest:update` (documented) throws locally; local Cypress scripts target an unserved portAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rescript-lang/rescript-lang.org#1415 ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug]: agent capture drops long Unicode text as punctuationForse già presa @ktz03 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
volcengine/OpenViking#5801 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Deepak3699/Ai_Mentor#244 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nextcloud/collectives#2843 ·
I maintainer di solito rispondono entro 1 giorno