Run in Browser fails with CORS error loading default.png, Pavlovia Pilot works

OS (e.g. Win10): Win 11
PsychoPy version (e.g. 2024.2.4 Py 3.8): PsychoPy Builder 2026.2.2
Standard Standalone Installation? yes
URL of experiment: Pavlovia
Do you want it to also run locally? yes
What are you trying to achieve?: trying to pilot locally which functioned previously

What did you try to make it work?: /What specifically went wrong when you tried that?: The specific error I am reporting wasn’t appearing last Thursday (which was the last time I worked on this project).

When trying to pilot in browser, both new experiment and old experiment that functioned fine previously (see the link above) fail with the same message. Chrome developer console reports:

Access to XMLHttpRequest at
'https://pavlovia.org/assets/default/default.png'
from origin 'https://localhost:12002'
has been blocked by CORS policy:
No 'Access-Control-Allow-Origin' header is present
on the requested resource.

Failed to load resource: net::ERR_FAILED

FATAL ... ServerManager._processLoadingError
unable to download resource: default.png

The problem occurs in multiple experiments, including older experiments that previously worked without issues.

Older experiments run successfully with Pavlovia’s Pilot but not with Run in Browser.

The default.png URL opens successfully when entered directly into Chrome.

Builder automatically includes the following entry in the generated JavaScript resource list:

{'name': 'default.png',
 'path': 'https://pavlovia.org/assets/default/default.png'},

Adding a local copy of default.png through Builder’s Additional Resources does not resolve the issue, because Builder still generates the original remote resource entry in addition to a local resource entry.

This appears to be specific to loading Pavlovia’s default image from the local browser runner, rather than a problem with the experiments themselves.

Question: Has anything recently changed in how the default image resource is served, particularly regarding CORS headers? Is this a known issue with Run in Browser, and is there a workaround that allows testing experiment without uploading it to Pavlovia first?

Thanks,

Olga

There are ways to bypass this in Chrome, https://chromewebstore.google.com/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf

That said you might check if this also happens using FireFox or another browser. It’s hard to tell if this is a Chrome issue or a JS issue more generally.

This issue has hit a few studies since the server upgrade on Sunday and we’re investigating the cause (and CORS!)

Best wishes,
Jon

Given that the issue wasn’t there last week, I am going assume it is neither Chrome nor JS but something related to server upgrade as Jon mentions below.

I checked today and the error disappeared; whatever y’all did on your end seemed to have solved the issue. Thanks!

Yes to confirm, we had increased the strictness of the CORS policy a little too far, making it hard to retrieve use valid pavlovia.org resources in local studies :slight_smile: