Could not check for JavaScript support. Please check manually if your webserver serves `.mjs` files using the JavaScript MIME type

The warning is thrown by this script:
/var/www/nextcloud/apps/settings/lib/SetupChecks/JavaScriptModules.php:

in the run Method:

  • This method performs the actual setup check.
  • It creates a URL for a test JavaScript file (esm-test.mjs), and this URL, along with the URLs of all trusted_domains of the Nextcloud server, is stored in an array ($testURLs).
  • Then, a loop is executed for each test URL.
  • For each test URL, it attempts to send a HEAD request to the server and checks the MIME type of the response.
  • If the MIME type matches either ‘text/javascript’ or ‘application/javascript’, it returns a success result (SetupResult::success()).
  • If a connection to the server cannot be established or the MIME type is incorrect, it generates corresponding warning or error messages.

In summary, this script attempts to reach the server (itself) using URLs constructed from trusted_domains array and checks whether the server correctly serves .mjs files with the appropriate JavaScript MIME type. The results are then returned as success, warning, or error messages based on the outcome of the check.

This means that the ‘trusted_domains’ in your config/config.php do not contain an entry that the server can use to reach itself. This can have many causes. Incorrectly set hostname, incorrect or insufficient DNS resolution, etc.
My suspicion[1] is that you have only entered hostname(s) in trusted_domains array that cannot be resolved by the server itself. So he can’t address himself.

Try adding “127.0.0.1” or “localhost” to the trusted_domains array and if that does not solve it, add the IP from the machine itself:

This is how you find the IP of the machine:

ip a|awk '/global/{if(found!=1){sub(/\/.*/,"",$2);print$2};found=1}'

[1] I had to base my assumptions on suspicion, because the support-template was (once again) barely filled out.


Much and good luck,
ernolf

3 Likes