gmail-automata icon indicating copy to clipboard operation
gmail-automata copied to clipboard

ReferenceError: utils_1 is not defined

Open Brinsky opened this issue 2 years ago • 12 comments

The current script attached to the sheet linked in the README seems to have some errors. Symbols that come from the utils.gs file are referenced with (0, utils_1.assert) and similar instead of directly by name. This results in ReferenceError: utils_1 is not defined when running the script.

Brinsky avatar May 26 '22 16:05 Brinsky

This appears to be a duplicate of #59 (which has a PR ready to go)

mlsad3 avatar Jul 30 '22 20:07 mlsad3

Hey @Brinsky @mlsad3 Is there a solution for "ReferenceError: utils_1 is not definedDetails"

Deybat avatar Aug 07 '22 15:08 Deybat

Yes, just add PR #59 from @aaronj1335 . It resolves this issue.

mlsad3 avatar Aug 07 '22 17:08 mlsad3

@mlsad3 is there a way to update the old script code with fix from @aaronj1335 directly in script.google.com and make it work with spreadsheets attache to it.

Deybat avatar Aug 11 '22 13:08 Deybat

Yes.... you can, but it requires taking that updated sheet, opening the Extensions->Apps Script page, and copying the content of each of the scripts into your own (and making any new scripts if they don't already exist).

I made some potential updates for the spreadsheet to help describe how to update. See attached images below, in particular, the "Updating" section:

gmailautomata1 gmailautomata2

mlsad3 avatar Aug 12 '22 03:08 mlsad3

Ohh!! @mlsad3 Thank you for this awesome instructions

i did try to update script code manually after using an online compiler to turn ts to js (didn't want to setup local Dev Environment) after saving the project i lost 'Gmail Automata' button from the main menu in the spreadsheet(i tried adding trigger as suggested in the README but didn't work)

i'll try to setup clasp and test again.

Deybat avatar Aug 12 '22 12:08 Deybat

If 'Gmail Automata' disappears, it's probably because your clasp setup worked and there is a script error. When it initializes the first time, it runs part of the script.

Click on 'Extensions' -> 'Apps Script', then inside the Apps Script, select the left menu "Executions" to analyze the log files (if any) of the extension.

image

Look for any mention of failure. Sometimes if it's too recent (a few seconds), you can click the refresh button to see if any logs were created.

mlsad3 avatar Aug 12 '22 14:08 mlsad3

Yes, you're right but am lost here not sure why it give that error Screenshot from 2022-08-15 13-16-16

Deybat avatar Aug 15 '22 12:08 Deybat

Hmm,

Looks like your online flow does not utilize the .claspignore file, and it deployed the Condition.test.ts file. That should not have happened, as they require Jest, and none of those libraries are ever deployed.

mlsad3 avatar Aug 15 '22 16:08 mlsad3

i did remove Condition.test.ts and the Gmail Automata button appear now but when trying to "Process Now" it fails Screenshot from 2022-08-15 19-55-24

Deybat avatar Aug 15 '22 18:08 Deybat

PR #59 recently (today) was merged, and should resolve that

mlsad3 avatar Aug 15 '22 20:08 mlsad3

Yes it did work now thanks again @mlsad3 for walking me through this. You're awesome.

Deybat avatar Aug 15 '22 23:08 Deybat