Code.js not updating

You guys have any joy with the firewall turned off?

I’ve had problems with my code not updating on my server too. I’m running the latest NSB version.
When this happens, i move a control such as a button to a different position on the screen then deploy again, and then everything updates as it should. Not sure why.

Whose server are you deploying to?

Don’t suppose we could write an Ajax call within the app to download code.js? Assume an ajax call won’t save code.js to where it needs to be saved?

Issue just started on my Galaxy S9+ today. To date it had only been on pc and with my firewall off it is not happening much.

George is there any chance you could save a code.js version in the index.htm (or somewhere else) file? The app could compare the versions on loading to make sure it it running the correct code.js. Very frustrating wasting time “fixing” a bug when your fixes aren’t even going through.

Followup: A day later my code.js was updating again. Suggestion, if you have a Google account try logging into a different account. When I did that it worked the day it was failing on two computers logged into the same Google account. The third computer was on a different account. Maybe just coincidental but worth a try.

John

It always updates for me within a day later. On the plus side at least you know clients are getting the app update eventually.

This code.js issue just started on my S9+ after having no problems for months. Anyone have any joy with this issue?

I had a similar issues years ago which I fixed by amending/adding a .htaccess file to the root public html folder on my server. I’ve never had that problem since.

You can search for the issue online, but I found some info here to get you started:

Hope this helps.

1 Like

I’m using AWS and in the cloudfront service I set the TTL to 10 seconds max. with min as 0 seconds. That cleared all my problems on all devices. Realizing you’re probably not using AWS, look for TTL (Time To Live) settings for your site on the server. For example, AWS defaults to 1 day - 86400 seconds. As I mentioned above, incognito seems to be the client side solution in a pinch, but not useful.

AWS Cloudfront is particularly a problem in that it is yet another level of cache on the server side. So not only does the TTL settings in Cloudfront send the TTL settings to the client browser, but it also uses it on the server side where Cloudfront is a cache between the internet and your actual site (that may be hosted on S3, for example). Cloudfront does all this to reduce access to the actual site and these server caches are distributed worldwide for access speed.

This issue is becoming a big hassle for me the past week. Virtually no apps are updating on mobile and chrome on pc regularly needs a hard refresh to get the code.js file.

George, I was wondering if there could be a property in the project which enables developers to specify the name of the code.js file? I know you shouldn’t need to but this is a real hassle for some of us and certainly not good for our clients.

This is almost certainly a configuration problem at your end. What are you using as a server?

There isn’t any way to override the name of the code.js file. Even if there were, the same problem would probably happen with another name.

I changed the last line in index.html to say <script src="code2.js"></script> then renamed the file on server to code2.js and it worked fine. The problem would arise again, certainly but when it did the property could be changed.

I’m not sure what to answer with regards to the server. It is hosted, I think, on a linux server with cpanel being the front end for email accounts, security settings etc.

I’m sure it is but I know nothing of how to start fixing it. Is .htaccess anything to do with it?

This is beyond what we’re able to help with here. Do you have a system admin, or does your provider have support?

Support, from my provider, with any experience seems hard to find. Then finding that provider who wants to help also a challenge.

A trick I’ve seen work is to add a query parameter to the URL:

http://www.appstudio.dev/myapp?time=1715

Doesn’t work for me sorry.

If you deploy to Volt Server, does it work properly?

Historically yes but I managed to do it today.

Code window bottom right
console top right
App left

The difference with Volt server is code.js is updated after a few minutes to the correct version of code.js.

Scratch that sorry. Service worker was just taking 4+ minutes to update. But once updated it was the correct code.js