## General developer forum

### Problem with javascript-static.js

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Re: Problem with javascript-static.js

Try clearing your cache. The path is changed for this static file to improve cacheability. javascript.php ensures that various headers are set to try and ensure that the browser caches the file, and is designed such that subsequent calls for the same file where the browser provides a Last-Modified header just result in a 304 not changed. javascript.php also minifies the files on the fly. The timestamp is to ensure that when you upgrade Moodle, the timestamp is reset, thus changing the URL, and a browser will re-request a different file.

If you clear your cache, this will remove the existing server cache of the minified file, reset the timestamp in the URL, and this should mean that you get the file served. Most likely, something has caused the cache to be incorrect somehow - this may happen if your storage is flaky for example, or something odd happened the first time the file was requested and a dodgy copy was stored. This shouldn't happen, so if know the cause, it may be worth raising an issue so that we can prevent similar things happening again.

Andrew

Average of ratings: -
Re: Problem with javascript-static.js

Thanks for the support

• I was getting a 404 error.
• Clearing the cache did not help.

I was not able to fix this even after reintsalling and upgrading - so I eneded up scrapping the virtual machine and reinstalling lamp+moodle.

Now I no longer have this problem.

Average of ratings: -
Odp: Re: Problem with javascript-static.js

Hi,

I have to bump this one.

I have the same problem - 404 on fetching javascript-static.js.

I tried to do purge-caches by console:

but no luck:

Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting. Theme and Css downloads ok the same for lang package in www app so it doesn't looks like bad$CFG->data root case.

Any help?

Average of ratings: -
Odp: Re: Problem with javascript-static.js

My problem looks the same as this https://moodle.org/mod/forum/discuss.php?d=236063&parent=1025929 but environment is different:

Moodle 2.7.2

Idea Web Server (compatible with Apache)

Also I can't to disabled 'Use slash' option because panel do not want to work without javascript...

-----

edit:

I installed fresh Moodle on local server went to server->HTTP section and copy link to it. Than I add my server address and went to this location. After turning off 'Use slash' everything back to normal.

Average of ratings: -