Javascript files are not included and object OC and OCA is undefinde

Sorry to hear you’re facing problems :slight_frown:

If you’re urgently looking for support to keep your business running, consider checking out our paid support options.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the following as you can (you can cut and paste this into your topic):


Nextcloud version (eg, 12.0.2):
Operating system and version (eg, Ubuntu 16.04):
Apache or nginx version (eg, Apache 2.4.18):
PHP version (eg, 7.0.22):
Is this the first time you’ve seen this error?:
Yes
Can you reliably replicate it? (If so, please outline steps):

The issue you are facing:
All of a sudden my site went down. I can login but I cannot see my files on dashboard. Also I cannot click on any of the menu items I cannot navigate to other pages. I am getting javascript errors in console all of them are about

Uncaught ReferenceError: OC is not defined
Uncaught ReferenceError: OCA is not defined

I am getting these errors on login page as well but I am able to login.

https://drive.google.com/file/d/0B8BViT9saNi1RWtUSk1kVUMtZms/view?usp=sharing

Here is the screenshot of error I am getting. I think main JS files are not included… Is there any way you can help me with that? Issue is with the front end that’s why there is nothing in log file.

Thanks and Regards,
Athar ud din
The output of your Nextcloud log in Admin > Logging:
Issue is with the front end that’s why there is nothing in log file.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):
Issue is with the front end that’s why there is nothing in log file.

The output of your Apache/nginx/system log in /var/log/____:
Issue is with the front end that’s why there is nothing in log file.


Remember, this information may be requested if it isn’t supplied; for fastest response please provide as much as you can :heart: Feel free to use a pastebin service, otherwise log files can be indented with 4 spaces on each line to present them in a friendlier way on the forum.

I had the same simptomes when playing with the url-modification-options in the config-file.

How did you resolve it?

If I remember correctly, I was trying to setup my nextcloud behind a proxy, which should do SSL-termination.

There are six parameters in the nc-config-file to manipulate domains https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#proxy-configurations

I can’t remember which one was used wrong. Sry.

Do your config include any of these parameters?

Keep in mind that you have to update .htaccess-file (occ comand: maintenance:htaccess:update) before your changes get visible.

If I remember correctly, I was trying to setup my nextcloud behind a proxy, which should do SSL-termination.

There are six parameters in the nc-config-file to manipulate domains https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#proxy-configurations

I can’t remember which one was used wrong. Sry.

Do your config include any of these parameters?

Keep in mind that you have to update .htaccess-file (occ comand: maintenance:htaccess:update) before your changes get visible.

I have found a similar error to this after following an upgrade of 12.03 to 12.04 and then follwing the guide at https://mangolassi.it/topic/12878/install-nextcloud-11-0-2-on-centos-7-with-php-7-1-from-remi/51

I used the instructions there to add a lets encrypt ssl and to change the base url to remove /nextcloud

I cannot for the life of me work out whats wrong with the config

can anyone point me in the right direction?

Hi,
As a commentary, 3 years later, I seem to experience the same kind of problem. And I cannot believe this issue has no answer yet.

Same here. The worst part? Everything was running great until it didn’t. Nothing happened in between. It just exploded randomly and I have 0 idea on what’s suddenly wrong with my proxy settings…

Well. It took me a while, but it was not the fault of nextcloud at all. The nginx reverse proxy got some corrupted caches that needed to be removed… I saw the light when I used an esoteric browser that was actually showing the real error: ERR_CONTENT_LENGHT_MISMATCH that indicated an abrupt closing of the stream.

This solved my issue jquery - Javascript - ERR_CONTENT_LENGTH_MISMATCH - Stack Overflow

1 Like

Thanks, this was very helpful.

Just had the same issue today and couldn’t find the reason anywhere… For me the reason was I ran out of space in my nginx proxy.

Just adding a reply here…

Best way to test is to access the server locally. If it works, then it’s the proxy in front that blocks. IN my case it was Sophos.