Could not check for JavaScript support. Please check manually if your webserver serves `.mjs` files using the JavaScript MIME type with other errors as per shows in picture

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 28.0.3
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04.4 LTS
Apache or nginx version (eg, Apache 2.4.25): nginx reverse proxy nginx/1.18.0
PHP version (eg, 7.4): replace me

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'upgrade.disable-web' => true,
  'instanceid' => 'i removed for now',
  'passwordsalt' => 'i removed for now',
  'secret' => 'i removed for now',
  'trusted_domains' =>
  array (
          0 => '172.24.8.5:8080',
          1 => '172.26.8.246',
          2 => 'example.cac.queensu.ca',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '28.0.3.2',
  'overwrite.cli.url' => 'https://example.cac.queensu.ca',
  'dbname' => 'db',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'i removed for now',
  'dbpassword' => 'i removed for now',
  'installed' => true,
  'mail_from_address' => 'i removed for now',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'i removed for now.ca',
  'mail_smtphost' => 'i removed for now',
  'mail_smtpport' => '25',
  'defaultapp' => '',
  'updater.release.channel' => 'stable',

  // Configuration for trusted proxies
  'trusted_proxies' => ['i removed for now'],

  // Overwrite parameters for reverse proxy
  'overwritehost' => 'example.cac.queensu.ca',
  'overwriteprotocol' => 'https',
  'overwritewebroot' => '/',
);

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

2024/04/01 16:34:50 [error] 538913#538913: *8797 access forbidden by rule, client: 172.24.8.5, server: mission.cac.queensu.ca, request: "HEAD /apps/settings/js/esm-test.mjs HTTP/1.1", host: "example.cac.queensu.ca"

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

hi @ welcome to the forum :handshake:

Please use the search - .mjs issue have been discussed already. post relavant reverse proxy config and logs in case you need additional help.

I tried almost everything but nothing seems helping me.

Tried to edit vhost file of nginx
hosts file
config.php file but nothing seems works and stuck on the same error.

Based on your config and some other hints, it appears you’re using Docker.

This error isn’t saying mjs isn’t working - it’s saying it can’t run the test to determine if it’s working.

The check connects from the Nextcloud Server to itself using https://XXX. Where “XXX” is each the entries in your trusted_domains.

Confirm you can connect from your Nextcloud container (not the underlying host) to one of those URLs. If you search you’ll find curl commands/etc for doing so.

In general, if you’re using one of the Docker images for Nextcloud out there, you’ll have mjs support unless you’re using old web server configs or something.

Thank you so much for replying. @jtr @wwe

Sorry I am dump here. Do not understand much but would like to learn about this.
I have followed this guide :

[> https://www.cherryservers.com/blog/install-nextcloud-docker](https://www.cherryservers.com/blog/install-nextcloud-docker)

I am doing this command from nextcloud container:

curl -I https://mission.cac.queensu.ca/apps/settings/js/esm-test.mjs
curl: (7) Failed to connect to mission.cac.queensu.ca port 443 after 0 ms: Couldn’t connect to server

curl -I http://mission.cac.queensu.ca/apps/settings/js/esm-test.mjs
HTTP/1.1 200 OK
Date: Tue, 02 Apr 2024 03:21:20 GMT
Server: Apache/2.4.57 (Debian)
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: noindex, nofollow
X-XSS-Protection: 1; mode=block
Last-Modified: Fri, 22 Mar 2024 14:18:02 GMT
ETag: “6d-614407de17cfa”
Accept-Ranges: bytes
Content-Length: 109
Vary: Accept-Encoding
Cache-Control: max-age=15778463
Content-Type: text/javascript

curl -I http://172.24.8.5/apps/settings/js/esm-test.mjs
curl: (7) Failed to connect to 172.24.8.5 port 80 after 0 ms: Couldn’t connect to server

/var/www/html# curl -I http://172.24.8.5:8080/apps/settings/js/esm-test.mjs
HTTP/1.1 200 OK
Date: Tue, 02 Apr 2024 03:31:41 GMT
Server: Apache/2.4.57 (Debian)
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: noindex, nofollow
X-XSS-Protection: 1; mode=block
Last-Modified: Fri, 22 Mar 2024 14:18:02 GMT
ETag: “6d-614407de17cfa”
Accept-Ranges: bytes
Content-Length: 109
Vary: Accept-Encoding
Cache-Control: max-age=15778463
Content-Type: text/javascript

This is what I get.

Here is my nginx conf:

`server {
listen 80;
server_name mission.cac.queensu.ca;
root /var/www/html;
return 301 https://$host$request_uri;
}

server {

listen 443 ssl;
server_name mission.cac.queensu.ca;
root /var/www/html;

ssl_certificate /etc/nginx/ssl/cert/certs_ca.bundle.crt;
ssl_certificate_key /etc/nginx/ssl/cert/certs_ca_ca.key;

ssl_protocols TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

access_log /var/log/nginx/nginx.vhost_mission.cac.queensu.ca_access.log;
error_log /var/log/nginx/nginx.vhost_mission.cac.queensu.ca_error.log;


    location  / {
       allow x.x.x.x;
       allow 10.0.x.x/24;
       deny all;

       proxy_pass http://172.24.8.5:8080;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;



    }

    location /.well-known/carddav {
    return 301 $scheme://$host/remote.php/dav;
    }

    location /.well-known/caldav {
    return 301 $scheme://$host/remote.php/dav;
    }

}
`
what can I do next for troubleshooting ?

in other words you connection with http://<serverip:8080> and ´http:´ works and https://<domain> fails. http:<domain> is little surprising as your reverse proxy is supposed to redirect http: to https: which should result in a failure as well… but at first glance It sounds like your reverse proxy HTTPS is not configured in a right way (certificate, firewall, port forwarding etc…)

It looks to me like, within your Nextcloud container, the DNS for mission.cac.queensu.ca resolves to likely the container’s IP address (or maybe 127.0.0.1) rather than what it really resolves to in your external DNS (presumably the IP address of your Nginx reverse proxy on your host). At the moment the check isn’t reaching your proxy to test via https.