Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New "currentURL is not defined" Error in Google Apps Script Web Apps

A few days ago this started appearing in my Google Apps Script Web App Consoles:

Uncaught (in promise) ReferenceError: currentURL is not defined at then.catch.e (content_script_bundle.js:13)

What might this be?

like image 764
webstermath Avatar asked Nov 28 '18 19:11

webstermath


People also ask

Why is my Google Apps Script not working?

Try debugging your script and see if you can isolate the problem. There is a bug in Google Apps Script that is causing this error. For instructions on searching for and filing bug reports, see the Bugs. Before filing a new bug, search to see if others have already reported it. Authorization is required to perform that action.

How do I use Google Cloud Error Reporting in Apps Script?

Note: To use Error Reporting in Google Cloud Platform, your Apps Script project must use a standard, user-managed GCP project instead of the default, Apps Script-managed GCP project. Exceptions that occur because of runtime errors are automatically recorded using the Google Cloud Error Reporting service.

Why doesn't my script have an error message?

There is an error in your script that doesn't have a corresponding error message. Try debugging your script and see if you can isolate the problem. There is a bug in Google Apps Script that is causing this error. For instructions on searching for and filing bug reports, see the Bugs.

How does an unverified app affect the script owner/developer?

Prompted by a comment by Edward Ulle it’s worth remembering that ‘unverified app’ also affects the script owner/developer. Steve Webster illustrates this in the following video where deploying a web app to execute as the developer and only run for the developer can lead to the app verification flow.


1 Answers

content_script_bundle.js is likely a script within a Chrome Extension. Ghostery has such a js file. Basically, it has caught an error of some kind

window.console.error("Could not run content script", e, currentURL()) 

Unfortunately, the line in the script that pushes the error to the console itself has a minor bug whereby currentURL has not been defined so it squawks.

Just turn off Ghostery or whatever and the error will disappear. Although, you can just ignore it. Easiest though is to right-click the console message and select "Hide messages from content_script_bundle.js" if it's bothering you. If it is Ghostery then mark your site as trusted as noted in the comment below. Probably the best solution.

This is a screenshot from Chrome Inspector.

enter image description here

like image 73
Gazzer Avatar answered Oct 02 '22 20:10

Gazzer