Loading module was blocked because of a disallowed MIME type

URL of experiment: https://run.pavlovia.org/_yazanso/incentivized-flanker-w-perceptual-load/

Description of the problem: Running the experiment on Pavlovia stops on “initialising the experiment…”. The console reports:
Loading module from “https://run.pavlovia.org/_yazanso/incentivized-flanker-w-perceptual-load/lib/data-2020.1.js” was blocked because of a disallowed MIME type (“text/html”).
etc.

I believe the “lib” directory is auto-generated somehow …? It does not exist in the GitLab repository. The experiment runs fine in local debug mode.

Why is this happening?

@arnon_weinberg, I think the issue is that you have no html folder, probably because your output path in experiment settings is blank. Add ‘html’ to the output path, delete the JS & html files in the parent folder, and resync with Pavlovia.

Thank you @dvbridges. I suspected that as well.

However, when I set the output path, then the experiment no longer works in local debug mode - because the resources directory is not pre-loaded. I followed (your) instructions to remove the output path in order to make local debug mode work.

Is there no way to make both local debug mode and Pavlovia work simultaneously?

Note: I see a workaround is to copy files to both locations, and the output path has to be adjusted depending on where it’s running. This may be workable for me, but I expect that it will be too complicated for the other members of the team contributing to this experiment, as it’s very easy to get it wrong.

Note: I realize now that the error message I pasted above, the one marked red with an exclamation mark in the console, is actually just a warning, and unimportant. The more important message, lower down and marked in a less noticeable light brown, is:
Loading failed for the module with source “https://run.pavlovia.org/_yazanso/incentivized-flanker-w-perceptual-load/lib/core-2020.1.js”.
My apologies for missing that.

While debugging this, I found a directory structure that works for both local debug mode and Pavlovia, with output path = html:

|-- conditions.xlsx
|-- html
|   |-- index.html
|   |-- IVA_V1.js
|   |-- IVA_V1-legacy-browsers.js
|   `-- resources
|       |-- conditions.xlsx
|       `-- resources
|           |-- *.png
|-- IVA_V1.psyexp
`-- resources
    |-- *.png

This setup requires images placed in /resources/*.png, and conditions.xlsx referring to them as resources/*.png. Any other combination (/*.png, /images/*.png, /html/resources/*.png, /html/resources/images/*.png, etc) does not work for both run modes. Export HTML copies the images to /html/resources/resources/*.png, and this seems to work.

1 Like