In my Apps Script add-on, I need to use an external library JSSoup for managing some HTML text. I followed this answer to figure out how to add/import an external library in Apps Script. Then I added eval(UrlFetchApp.fetch('https://github.com/chishui/JSSoup/blob/master/lib/jssoup.js').getContentText();
in my script but it is throwing this error:
SyntaxError: Unexpected token '<'
No more logging available for this error. How can I resolve this error?
Upon checking the fetched content, it shows the all the page content rather than just the code. It is because you are getting all the content of that page, not just the code. Use the raw version instead by clicking the Raw
icon and should redirect you to the correct link.
eval(UrlFetchApp.fetch('https://raw.githubusercontent.com/chishui/JSSoup/master/lib/jssoup.js').getContentText());