Help fix :Your webserver does not serve `.mjs` files using the JavaScript MIME type."

Support intro
Your webserver does not serve `.mjs` files using the JavaScript MIME type. This will break some apps by preventing browsers from executing the JavaScript files. You should configure your webserver to serve `.mjs` files with either the `text/javascript` or `application/javascript` MIME type.

Nextcloud version : 28.0.5
Operating system and version : TrueNAS-13.0-U6.1
Apache or nginx version : probably nginx
PHP version : 8.0(need to learn updating php before fixing this)

The issue you are facing:

Since 28.0.1 I am getting this warning but now its show in red and I wonder if its a concerning item.

Is this the first time you’ve seen this error? No

Steps to replicate it:

  1. upgrade nextcloud jail successfully
  2. Warning is presented on the admin Overview page.

The output of your Nextcloud log in Admin > Logging:

show a blank page. Though i see a lot of log error listed under notifications as 
........
 array (
    0 => 'localhost',
    1 => '10.13.58.33',
    2 => 'mydomain',
    3 => '127.0.0.1',
  ),
.........

The output of your Apache/nginx/system log in /var/log/____:

couldn't locate this file

This might be the similar issue and solution.
https://help.nextcloud.com/t/could-not-check-for-javascript-support-please-check-manually-if-your-webserver-serves-mjs-files-using-the-javascript-mime-type/182321

This was a change for NC 27, you have to do updates either to the specific nginx configuration of your Nextcloud:
https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html#nginx-config

Or just for this specific change, your nginx config probably has a file mime.types (for FreeBSD in /usr/local/etc/nginx), you can just change the line for javascript extension from:
application/javascript js;
to:
application/javascript js mjs;

1 Like