How to make apache serve .js.map

Nextcloud version (eg, 29.0.5): 29.0.5
Operating system and version (eg, Ubuntu 24.04): Debian 12 2024-06-01
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.61
PHP version (eg, 8.3): 8.1.29

The issue you are facing:

Setup check error:
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.

I also did not find in the documentation or Upgrade to Nextcloud 28 — Nextcloud latest Administration Manual latest documentation how to add .js.map to Apache.

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

Steps to replicate it:

  1. Just check the Security and setup warnings on NC29.

The output of your Nextcloud log in Admin > Logging:

Nothing relevant.

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

Nothing relevant.

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.

Nothing relevant.

Do you have any other warnings or errors?

With Apache you shouldn’t need to do anything. What happens when you run the following from your Nextcloud Server?

curl -I https://domain.tld/apps/settings/js/map-test.js.map

Do you get a 200 or a 404?

1 Like

I get 200:

/**

  • This is a dummy file for testing webserver support of JavaScript map files.
    */
    {}

Currently I have a lot of warnings:

    Could not check that the data directory is protected. Please check manually that your server does not allow access to the data directory. To allow this check to run you have to make sure that your webserver can connect to itself. Therefor it must be able to resolve and connect to at least one its `trusted_domains` or the `overwrite.cli.url`.
    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.
    Could not check for JavaScript support via any of your `trusted_domains` nor `overwrite.cli.url`. This may be the result of a server-side DNS mismatch or outbound firewall rule. Please check 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 webserver can connect to itself. Therefor it must be able to resolve and connect to at least one its `trusted_domains` or the `overwrite.cli.url`.
    Could not check if your web server properly resolves the OCM and OCS provider URLs. To allow this check to run you have to make sure that your webserver can connect to itself. Therefor it must be able to resolve and connect to at least one its `trusted_domains` or the `overwrite.cli.url`.
    15 errors in the logs since August 27, 2024, 5:44:17 PM

    Could not check that your web server is properly set up to allow file synchronization over WebDAV. Please check manually. To allow this check to run you have to make sure that your webserver can connect to itself. Therefor it must be able to resolve and connect to at least one its `trusted_domains` or the `overwrite.cli.url`. For more details see the documentation ↗.
    Could not check that your web server serves `.well-known` correctly. Please check manually. To allow this check to run you have to make sure that your webserver can connect to itself. Therefor it must be able to resolve and connect to at least one its `trusted_domains` or the `overwrite.cli.url`. For more details see the documentation ↗.
    Could not check for WOFF2 loading support. Please check manually if your webserver serves `.woff2` files. To allow this check to run you have to make sure that your webserver can connect to itself. Therefor it must be able to resolve and connect to at least one its `trusted_domains` or the `overwrite.cli.url`. For more details see the documentation ↗.
    Could not check that your web server serves security headers correctly. Please check manually. For more details see the documentation ↗.

Actually I created another thread for it, but got nowhere yet.

Ah, okay now it makes more sense. These checks are failing due to the reasons mentioned in the docs you linked to. These are related problems. Please check those various mentioned settings/parameters in your environment:
https://docs.nextcloud.com/server/latest/admin_manual/release_notes/upgrade_to_28.html#setup-checks

I basically checked everything looks fine and I had no warnings on NC 28. Then I replied to you in that thread:

“Based on this notes I discovered that my nextcloud instance is not able to wget or curl its own domain. But it always worked without that, so now we need to loosen the security of our instance opening firewall rules to have security checks? It sounds a bit bad…”

I checked basically all mentioned parameters in the documentation and found nothing wrong. Do you have any idea?