Got error as the subject repeatedly while trying to save “Google Calendar Facility Booking Add-on” as Code.gs in the Google Apps Script, Gemini confirmed as below and I did follow but still got same error…
Gemini: I can confirm that the code in the Canvas is not missing any closing braces for any of the functions. Every function, loop, and try...catch
block in the script has its opening {
and closing }
braces correctly matched. The code is syntactically complete.
Based on the screenshot you provided, the error message now points to the line facilities.forEach((facility, index) => {
, which is also a perfectly valid line of code. This further confirms that the issue is not with a visible syntax error like a missing brace.
The most probable cause is a non-printable, hidden character or a persistent caching issue within the Apps Script editor itself. The editor is getting confused by something that we cannot see.
I strongly recommend you follow the steps I provided previously, using a plain text editor to strip out any hidden characters, as this is the most reliable way to resolve such an issue.
Line 120:
facilities.forEach((facility, index) => { // Display both weekday and holiday prices in the dropdown item checkboxGroup.addItem( `${facility.Name} - Weekday: $${facility['Price (weekday)']} / Holiday: $${facility['Price (holiday)']}`, JSON.stringify(facility), // Store the full facility object in the value index === 0 // Pre-select the first item ); });