41
Views
2
Comments
Single line comment on the last line of JavaScript wont compile

Due to the headache of having to publish every time I want to see a change I usually code and debug my JavaScript outside of OutSystems. One thing I like to do to help future me or anyone looking at my code is comment the hell out of it.

Once I'm happy with the code I'll paste it into the relevant JavaScript Element. I found a real head scratcher the other day when I pasted in a chunk of JavaScript and Service Studio said "nope - try again, mate" or words to that effect ;)

Anyhoo I discovered this little quirk in the editor. If your last line of JavaScript contains a single line comment  ("//") then Service Studio wont compile. Block comments work fine and if you add a blank line to the end this will also work fine. (see screenshot)


I'm new to OutSystems so it would be useful to know : are any other quirky gotchas I should be aware of?




2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

The only similar thing I can think of is to never use single-line comments in SQL, especially not when not at the start of a line, as first all line breaks are removed, and everything after the single-line comment ends up as comment.

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello Chris.

I also faced this error today.

You can end a line of code with ; or with a comment, but if it is a comment, you need to give an extra line break.

We just need to wait for OutSystems to release an improved version.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.