I’ve been playing around with my first web target. I’ve got a Lightsail server running and successfully deployed my app to it. Now I’ve made some changes to my app and re-deployed it but it no longer runs on the server. It still runs locally without issue.
I get the javascript black box error with “This application has encountered an error and cannot continue” as the title and the first error line is “Could not execute returned javascript: Can’t find variable: textlabel”.
Initially the variable was “timer” and so I thought I must have an issue with the (only) WebTimer on my single-page app and deleted that control. Then the error seems to have “moved” to the next control.
I’m guessing that there’s no error with the named variable and there’s something else at play here?
I tried creating a blank web page and setting that as the startup page and my app would then run.
So then I tried adding a single label control to the new blank page and, as soon as I did that, my app would no longer run. The error log is:
Could not execute returned javascript: Can't find variable: textlabel
Source: Xojo.view.confirmationText = "You are about to leave the app...";
Xojo.events.setSessionTimeout(300);
new textlabel('xNbBH5Sa',['TextChanged']);
Xojo.controls['xNbBH5Sa'].setEnabled(true);
new frameworkObject('T2kgeJrC',['Close','Open','Shown']);
Xojo.controls['T2kgeJrC'].setEnabled(true);
Xojo.view.showPage('T2kgeJrC');
document.title = "Untitled";
Xojo.view.dismissLoader();
If I change the single control on the page from a label to a button, the first line of the error log changes to:
This works fine in debug mode but not in my AWS Lightsail (EC2) instance. My app and database are in their own folder off the user’s home folder and, even though I am executing the app from within that folder, SpecialFolder.CurrentWorkingDirectory is returning the root folder. I think that might be because I’m executing it with “sudo”?
When I tried using “nohup” instead, my app never launched. I also tried SpecialFolder.UserHome.Child(“Dashboard.sqlite”) and it also returns the root folder. So I wound up having to hardcode the database location.