Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

API Source Concatenation Leads to Script Errors

1553447496

Edited 1553447797
GM Michael
API Scripter
When the API concatenates the source files to make apiscript.js, it does not inject newline characters between them.  Ordinarily, this is fine, but if the last line of a script is a // comment, the first line in the next file will be treated as a comment, potentially breaking some scripts and functionally deleting the following script is it is minified.
1553452787

Edited 1553452815
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, it's been that way since the API's start. Avoid using comments at the end of a script, or use /*YOUR COMMENT HERE*/ instead. Additionally, it means that if you don't end your script using proper syntax, it can also break.