I converted my sheets from the old to the new sheets as the code started creating sheets in the new version which was causing it to fail. After converting, I am now getting another error which I cannot find a solution for.
The error seems to be when using UiApp which calls a server handler and there is a library attached to the project. The error occurs even when there is no code in the library. The error occurring is:
Server Error: We're sorry, a server error occurred. Please wait a bit and try again.
Steps to reproduce
(1). Create 2 new sheets, use one as the library and one as the test sheet
(2). In the library, add a new version to the project then add the project as a library in the test sheet. There should be no code in the library (doesn't really matter either way).
(3). In the test sheet, add the following code:
function test() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var app = UiApp.createApplication();
// create a button and handler
var buttonHandler = app.createServerHandler("buttonTest");
var button = app.createButton("Button Test");
button.addClickHandler(buttonHandler)
app.add(button)
ss.show(app); // Display the app
}
function buttonTest(e) {
// nothing here is executed
}
(4). Run the test code
The following error is displayed: Server Error: We're sorry, a server error occurred. Please wait a bit and try again.
If the library is removed then it will run as expected