psychopy.org | Reference | Downloads | Github

SecurityError: Failed to read the 'cssRules'

URL of experiment: Online_ToM [PsychoPy]

The experiment is in PILOTING mode

Description of the problem: I got the following error :

  • SecurityError: Failed to read the ‘cssRules’ property from ‘CSSStyleSheet’: Cannot access rules

See also screenshot
Capture d’écran 2021-06-30 à 19.45.24

But if I press OK, the experiment is running correctly. Any idea how to get rid of this message?

Thank you for your help.

In some browsers, if a stylesheet is loaded from a different domain, accessing cssRules results in SecurityError .
CSSStyleSheet - Web APIs | MDN

Are you loading a style sheet that isn’t in your experiment folder?

Hi @wakecarter,

Thank you for your quick reply.

I think I see where is the problem.
I duplicated the files from the HTML folder to the main folder of the experiment.

I guess it created some mismatch with the pathway of the file

I will regenerate the file and see if it can solve my problem.

Thank you

I almost never make direct edits to files on Gitlab – I let the sync from PsychoPy Builder do the file management.

Yes, I did that usually but for some unknown reasons, the PsychoPy builder was not updating the files outside of the HTML folder.

When I tried to generate the JS it was only updated in the HTML folder but not in the main folder of the experiment. So when I tried to SYNC with Gitlab it didn’t SYNC the last version of the JS.

I am a newbie with PsychoPy and the SYNC was working perfectly fine until today. So I don’t know what happens exactly.

Maybe it’s because I didn’t update the experiment in the Builder but tried to generate only a new JS file?

Unless you are using a version prior to 2020.2.5 then you shouldn’t be outputting to an html folder. Look at Experiment Settings / Online. There’s no html in your run link so you probably shouldn’t have one.

I click save and then sync in Builder (generating html on sync).

1 Like

Ok, I was probably misguided by comments posted about previous versions. I deleted the HTML folder, and the experiment is running smoothly online without an error message.

Thank you for your help!
:raised_hands:

1 Like