Your webserver is not set up to serve `.js.map` files. Since Nextcloud 28 (Now: 30)

Nextcloud version (eg, 29.0.5): 30.0.0
Operating system and version (eg, Ubuntu 24.04): openSUSE Tumbleweed
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.61 (Linux/SUSE)
PHP version (eg, 8.3): PHP 8.3.9

THE ISSUE

<VirtualHost *:443t>
    Alias /nextcloud /srv/www/htdocs/nextcloud/
...

config.php:

  'htaccess.RewriteBase' => '/nextcloud',
  'overwrite.cli.url' => 'https://myhost.net/nextcloud',

Then I can access https://myhost.net/nextcloud

BUT: I get warnings like so:

    * Your webserver is not set up to serve `.js.map` files. Without these files, JavaScript Source Maps won't function properly, making it more challenging to troubleshoot and debug any issues that may arise.

    * Unable to run check for JavaScript support. Please remedy or confirm manually if your webserver serves `.mjs` files using the JavaScript MIME type. To allow this check to run you have to make sure that your Web server can connect to itself. Therefore it must be able to resolve and connect to at least one of its `trusted_domains` or the `overwrite.cli.url`. This failure may be the result of a server-side DNS mismatch or outbound firewall rule.

    * Could not check that your web server serves security headers correctly, unable to query `/nextcloud/heartbeat` For more details see the documentation ↗.

If I remove the Alias from <VirtualHost>, and do:

config.php:

  'htaccess.RewriteBase' => '/',
  'overwrite.cli.url' => 'https://myhost.net/',

The tests work, and I get rid of the warnings in Nextcloud.
BUT: now I have to access through the host URL, without the /nextcloud -part

https://myhost.net/

The warnings became an issue sometime in NC 28 or 29: Upgrade to Nextcloud 28 — Nextcloud latest Administration Manual latest documentation
I never bothered with it, but now it’s getting annoying enough.

Any tips how to be able to use the URL https://myhost.net/nextcloud AND NOT have the warnings?

ADDTIONAL INFO:
./occ maintenance:update:htaccess has been run when making config.php changes.

1 Like

Still not working without the warnings, but I’ve seemed to have messed up my earlier config a bit.

So, the Alias /nextcloud ... part is really not needed.

<VirtualHost *:443>
   # The actual Nextcloud content is in /srv/www/htdocs/nextcloud
  DocumentRoot /srv/www/htdocs
  ServerName myhost.net

So, I am able to access https://myhost.net/nextcloud just fine.

Still I have the warnings and my config.php now containing:

  'htaccess.RewriteBase' => '/nextcloud',
  'overwrite.cli.url' => 'https://myhost.net/nextcloud',

Also, these return 200 OK, when executed on my Nextcloud web server host:

 curl --insecure -I https://myhost.net/nextcloud/apps/settings/js/esm-test.mjs
 curl --insecure -I https://myhost.net/nextcloud/heartbeat

Effectively it seems that the tests cannot take into account the fact that the service URL has /nextcloud at the end, which is why the warnings are produced.

So, as far as I could read this, since I can access nextcloud/heartbeat and apps/settings/js/esm-test.mjs, the warnings actually are not correct?

2 Likes

I experienced the same warnings just when I upgrade from NC 29.0.6 to NC 29.0.7. With 29.0.6 all checks were fine, no warnigs. After upgrading to NC 29.0.7 these 3 warnings appeared. Anyway, aparently all works fine. All the work I execute within the cloud doesn’t show any problem.
Somehting in the version 29.0.7 has made changes in the version 29.0.6 that cause the warnings.
What is it?

3 Likes

Same here, so I have not experienced any issues in my limited Nextcloud service.

But, to be honest, warnings like these bother quite a bit. Not to mention there is no good documentation to perform the manual tests, referred to in the warning texts. The only hint is pretty much in the lines of “most admins use ‘curl’ for such debugging”.

1 Like

Hi @RoyalBlue @Etelop please use search and review

I have had the same errors after the update from 29.0.6.
I struggled with this issue for too long until I changed the /etc/apache2/conf.d/nextcloud.conf apache config from directory-based to virtual host config according to Installation on Linux — Nextcloud latest Administration Manual latest documentation

Since the configuration change all errors and warnings miraculously cleaned up from my nextcloud diagnostics.
However, I had to reconfigure the server URL in all my clients.

P.S
My latest experience with nextcloud makes me think that although nextcloud formally supports directory-based apache config, their QA doesn’t thoroughly test directory-based configuration for the couple of latest releases.

You can run both side by side as I explained → here ←


Much and good luck,
ernolf