processing / p5.js-web-editor

The p5.js Editor is a website for creating p5.js sketches, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! You can create, share, or remix p5.js sketches without needing to download or configure anything.
https://editor.p5js.org
GNU Lesser General Public License v2.1
1.41k stars 1.35k forks source link

Image not working #3062

Open joemckay5 opened 8 months ago

joemckay5 commented 8 months ago

p5.js version

1.9.1

What is your operating system?

Mac OS

Web browser and version

Chrome 122.0.6261.129 Safari 17.4

Actual Behavior

Images are not loading. Unfortunately, this bug is intermittent but my student are finding their images don't work. This is happening on computers in the lab, and on their personal laptops. Often if they switch from Safari to Chrome it works without any changes to the code or file structure. However, we have seen this happen in chrome too.
I'm sorry I can't be more specific. Is anyone else having this problem?

Expected Behavior

Images should load but they are not.

Steps to reproduce

Simple beginner image loading code is not working. It's not the code because it will intermittently, and if we switch browsers.

AweehGoblin commented 8 months ago

I've been notice this exact issue with my students as well. This is the first I've encountered it. Images will load one day and not the next. Sometimes creating a folder helps sometimes it does not. Updating Chrome hasn't helped nor does resigning into the Editor.

raclim commented 8 months ago

Thanks for raising this! Do you have URLs to specific sketches that we could try looking into as a starting point?

AweehGoblin commented 8 months ago

Hi raclim, thanks for responding. Here's an example file:

https://editor.p5js.org/adrianalassa/sketches/bm9Xm2HLr

joemckay5 commented 8 months ago

Here's another example if it helps. I'm on a mac on Chrome.
https://editor.p5js.org/Joemckay/sketches/OJACRmxxo If I try the same sketch on my PC (also Chrome) it works. For good measure I downloaded it, and it works fine locally on my mac in VisCode.

lindapaiste commented 8 months ago

@joemckay5 I'm not able to reproduce the problem with your cheese image. I'm seeing it loading fine in Chrome on Mac and PC from URL https://assets.editor.p5js.org/585c2eb657a80d014e1294a9/9312118d-8b44-4829-bb74-9050f820462c.png

@AweehGoblin I'm seeing an error on this one. The window image loads fine but the can does not. can: https://assets.editor.p5js.org/65b06b09eefa35001de6d7b0/c203a665-9aa4-4a0d-91f9-2e1eba1c08ed.png window: https://assets.editor.p5js.org/65b06b09eefa35001de6d7b0/2d8567ff-2a72-43fb-bff3-3d164706a278.jpeg

The network request shows that it is returning a 200 success response. It should not return a 200 if there is no data. We need to look into how we are fetching and serving the images from the S3 bucket. We recently updated a dependency and it could be related to that? #2443 I don't know how the assets.editor.p5js.org subdomain is set up.

joemckay5 commented 2 months ago

Has there been any progress on this bug? We had the same problem in class yesterday. The student changed from Safari to Chrome and the problem went away. I want to teach the class with the p5 code editor, but if this is going to be an issue again this semester I'll have to switch to something else.

joemckay5 commented 1 month ago

I've been playing with this a bit today. This sketch still doesn't work for me in Chrome on mac, but does in Safari. https://editor.p5js.org/Joemckay/sketches/OJACRmxxo I noticed today that it does work in Chrome in incognito mode. Not sure if that makes sense to anyone.

raclim commented 1 month ago

@joemckay5 Thanks for following up on this! I'm sorry for the delay on this issue—I've been having some difficulty pinpointing it down!

The cheese image is currently showing up for me in my browser. However, earlier today in a similar issue I noticed that it might be related to the way requests are being cached by the browser, which is why the images might load on incognito mode or that this issue is happening inconsistently. Would you be able to confirm this by opening the developer tools and checking the "Disable Cache" field (reference image in linked issue) and reloading the page?

joemckay5 commented 1 month ago

That worked!