Adding a textfield to a mostly empty project = js error

I was just doing a little proof of concept / testing with someone in California and uploading a web app to their server. To start I had everything hard coded in a button- no problem. Code executed and displayed a result (just trying to connect to a db). Then I added a textfield for them to make the process in the button dynamic and I get the following error:

Could not execute returned javascript: textcontrol is not defined Source: var langdir = document.getElementsByTagName('body')[0]; if(langdir) { langdir.removeAttribute('dir'); } var langdir = document.getElementsByTagName('body')[0]; if(langdir) { langdir.setAttribute('lang','en'); } new button('OAldPWDG',['Action']); Xojo.controls['OAldPWDG'].setEnabled(true); Xojo.controls.OAldPWDG.setAutoDisable(false); new textcontrol('Y4L91o2G',[]); Xojo.controls['Y4L91o2G'].setEnabled(true); new frameworkObject('UV80jx3p',['Close','Open','Shown']); Xojo.controls['UV80jx3p'].setEnabled(true); Xojo.view.showPage('UV80jx3p'); document.title = "Untitled"; Xojo.view.dismissLoader();

So if I have only the button, the app loads. If add a textfield with all defaults (no new code yet), it fails. Is the above related to a language file? I see the folder en.UTF-8 in the Resources folder and that folder and all its contents have 755 permissions. Could this be related to that?

Post an example project so we can take a look.

https://drive.google.com/file/d/1RzCs4e5rGrixv4V9A0zi-68UPeiPn47Z/view?usp=sharing

Will that work? All I’ve done is remove the db info.

I don’t get the error in the demo project.
Do you get the error in the demo project you just uploaded?

[quote=373926:@Tim Parnell]I don’t get the error in the demo project.
Do you get the error in the demo project you just uploaded?[/quote]
I do… so I guess that implies some kind of a permissions error. Should be a somewhat specific one, given that the app runs with fewer controls. I guess I’ll have to see about getting the logs on that server.

[Fri Feb 16 13:15:22.396340 2018] [cgid:error] [pid 9884:tid 140466760705792] [client 70.39.250.16:31614] End of script output before headers: myapplication.cgi, referer: http://txt.beldenstreet.com/cgi-bin/myapplication.cgi Use of uninitialized value $length in subtraction (-) at /home/belden5/txt.beldenstreet.com/cgi-bin/myapplication.cgi line 131. Use of uninitialized value $length in subtraction (-) at /home/belden5/txt.beldenstreet.com/cgi-bin/myapplication.cgi line 131. Use of uninitialized value $length in numeric eq (==) at /home/belden5/txt.beldenstreet.com/cgi-bin/myapplication.cgi line 130. Use of uninitialized value $length in numeric eq (==) at /home/belden5/txt.beldenstreet.com/cgi-bin/myapplication.cgi line 130. [Fri Feb 16 13:23:29.991130 2018] [cgid:error] [pid 9946:tid 140466687276800] [client 70.39.250.16:45530] End of script output before headers: myapplication.cgi, referer: http://txt.beldenstreet.com/cgi-bin/myapplication.cgi [Fri Feb 16 13:23:29.991161 2018] [cgid:error] [pid 9946:tid 140466655807232] [client 70.39.250.16:46074] End of script output before headers: myapplication.cgi, referer: http://txt.beldenstreet.com/cgi-bin/myapplication.cgi Use of uninitialized value $length in subtraction (-) at /home/belden5/txt.beldenstreet.com/cgi-bin/myapplication.cgi line 131. Use of uninitialized value $length in numeric eq (==) at /home/belden5/txt.beldenstreet.com/cgi-bin/myapplication.cgi line 130. [Fri Feb 16 13:25:07.104315 2018] [cgid:error] [pid 9946:tid 140466624337664] [client 70.39.250.16:51602] End of script output before headers: myapplication.cgi, referer: http://txt.beldenstreet.com/cgi-bin/myapplication.c

$length is defined in the cgi file on line 127:

$length = unpack(PACK_KEY,$length);

and then used in a loop on line 130-131.

You shouldn’t do anything to the files that Xojo outputs when it builds.
Maybe @Greg O’Lone can help here?

[quote=373931:@Tim Parnell]You shouldn’t do anything to the files that Xojo outputs when it builds.
Maybe @Greg O’Lone can help here?[/quote]
Oh I know- I was hoping maybe seeing what the CGI was failing on would trigger something in someone’s memory that had seen it before.

textcontrol is not defined means that somehow the framework didn’t load completely. With the demo project having almost no code to it, in addition to it working when I tested it, I don’t think it’s your project. Unfortunately that means it’s not something I can help with :frowning:

Here’s what I think…

It sounds to me as if the browser didn’t get a new version of the framework when you built again. The IDE only includes the parts you used, so the first build only had the global stuff and the button code. When you added the TextField and built again, the binary also included the TextField JavaScript code, but the browser didn’t get it for some reason.

Often the answer is an overzealous proxy server thinking it’ll save you time by not requesting the “same” file again, and while some of the code you need is there, not all of it is.

Cleat the browser‘s cache?

Sorry for the late reply. This was indeed a caching issue. The server was caching old files and this was revealed by reloading the page without cache from the browser. Sorry it took me so long to get back here. Thanks again for your help!