mogsdad / SheetConverter

Google Apps Script library - interprets Google Sheets Formats, converts to formatted text or html
49 stars 26 forks source link

Issue: SyntaxError: Unexpected token 'class' (line 58, file "Code", project "SheetConverter" #18

Open tomatokevin opened 4 years ago

tomatokevin commented 4 years ago

Description of issue

cannot run and is showing error message SyntaxError: Unexpected token 'class' (line 58, file "Code", project "SheetConverter"

Cell Format exhibiting problem

Expected result vs Observed result

cannot run and is showing error message

Installed Library Version

6

mwarden commented 4 years ago

I can confirm this. Interestingly, I don't have to even try to use the library for the error to result; all that is required is that it's added to the project as a resource. If I remove it, the error doesn't happen. Add it back in, it happens, even if I'm not utilizing the library anywhere in my code.

Another interesting bit. I have other scripts using the exact same version of the library, created a number of months ago. I just ran those and there is no issue. It's only the script where I am newly adding the SheetConverter library where I'm getting this error.

It's the exact same error reported here: SyntaxError: Unexpected token 'class' (line 58, file "Code", project "SheetConverter"

I have a strong suspicion this is related to the new runtime. In the older project, where your library works fine, I get prompted by "Enable new Apps Script runtime powered by Chrome V8 for this project". I bet that if I clicked "Enable", I would start getting your error.

I tested this on the new google sheet by going to Run -> Disable new Apps Script runtime powered by Chrome v8. Then I reran code both not using your library and using your library. No error.

To @tomatokevin, I recommend doing the above as a workaround for now

Long term, the code needs to be adjusted to support the new runtime (or both runtimes)