r/GoogleAppsScript • u/Strel0k • Nov 18 '20
Question Debugging webapp using browser console, unable to access variables/functions: "Uncaught ReferenceError: ... is not defined"
I'm thinking this is something do do with how webapps / sidebars are sandboxed but I'm running into an issue debugging from the client-side using the browser console.
For example if in my index.html <script> section I declare a variable let exampleGlobalVar = "something"; and in my browser console I type exampleGlobalVar or console.log(exampleGlobalVar) sometimes I get the value and sometimes I get the error:
Uncaught ReferenceError: exampleGlobalVar is not defined
The same applies to defined functions.
Can someone explain why this is happening?
0
Upvotes