ReferenceError: Can't find variable: Enabler, Google Web Designer Published Locally - javascript

I have received several ads exported from the Google Web Designer tool in the folder format:
/Ad-Name/
|-index.html
|-image.jpg
|-overlay.png
However when I open index.html in Safari 14.1.2 nothing loads, and when I check the console I find the error:
ReferenceError: Can't find variable: Enabler
Which points me to this line:
Enabler.addEventListener(studio.events.StudioEvent.EXPAND_START, this.H);
I assume it should be coming from this script tag on line 2000 something:
<script data-source="https://s0.2mdn.net/ads/studio/Enabler.js" data-exports-type="gwd-google-ad" src="https://s0.2mdn.net/ads/studio/Enabler.js"></script>
Even when I move it above the line where the Enabler object is used first, nothing changes.
The most darndest thing is that it did work for about five minutes earlier today. Because of this I thought there might be some kind of cache issue but I get the same error after clearing all my data.
Reading the docs has not helped.

Related

JSON Parse error: Unrecognized token '!' - error caught by Sentry

The error in the title is caught by Sentry (an error tracking tool). Below is a screenshot from Sentry - showing the stack trace.
Note: the script /en_US/iab.autofill.payment.js where handleMessage is located is loaded from Facebook (link here), and I couldn't find this script in the javascript bundle, nor anything related to it. I assume it's loaded by a 3rd party script - I'm using Google Tag Manager (which is also loading Facebook Pixel), Segment (loading Hotjar and Mixpanel), and Snapchat. The error started to appear without any changes in these scripts or the services that they're sending data to.
Note 2: It seems that the error is triggered quite often, about 10-15% of the time. I tried to reproduce it but given that it's a handled error, it doesn't show in the dev console.
Any direction on where to look would be much appreciated.
I'm seeing this a lot, and it seems to be coming 100% from users using Facebook browser on iOS (I guess this is the browser you see when you're using the Facebook app).
I tried to debug this with a snippet:
<script>
window.addEventListener('message', function (e) {
console.log(e);
JSON.parse(e.data);
console.log('foo');
}, false);
</script>
This is from the library you linked. Assuming that e.data is JSON string (not e.g. an object?), without any safeguard seems to be breaking things.
The second console.log doesn't fire, so I think this is causing some unexpected behaviours in my case (buttons not reacting to clicks with js listeners etc)
I don't know if there is a workaround or a way to protect from this in Facebook embedded browser (I guess it's loaded there)
Looking forward to hear more info
i have meet that too, its because the one script facebook inject in. will postMessage(Object), but the another script will listen the message and try to JSON.parse an object ,so it will came out a error. u can use 'vconsole' lib, and add a window.addEventListener('message',(e)=>{console.log(e.data)}) and u can see that
Apparently, the issue went away after a couple of weeks without changing anything on my side.

Occasionally getting Reference Error in Javascript console

I am occasionally getting different types of Reference errors logged in chrome console.
For eg: require not defined
Cookies not defined
lozad not defined
The code is bundled in static-internal-bundle.js which is a combination of 7 different util files and minified using gulp-minify.
This error is coming mainly when the url is hit from paid.braintree.com Ad urls and has utm_source, utm_medium and utm_campaign as query parameters.
This error is not consistent and mostly does not reoccur if the site is refreshed.
Also, it has been logged in sentry for all types of devices and Os for over 1.5k times in 6 months. Though it gets logged in console, nothing seems to break on the webpage.
What could be the possible reasons for this type of error?
<script type="text/javascript" src="https://static.pens.com/576801d7b3a368c06ba1944c07fe260b970da596/build/static-internal-bundle.js"></script>
This is the script that gets added into the page in which the error is coming.
I would add this as a comment but StackO won't let me without 50+ rep... I'll edit as needed.
Possibly the error could be in using "require" on the browser side, as browsers do not implement require
This sounds like a problem I have had with Babel, if it is being used I would try updating.

Google Sheets API node.js quickstart won't work: The API returned an error: Error: unauthorized_client

I've been messing with the Google Sheets API for a project and everything has been going pretty well. I followed all the steps On this page and got the quickstart working great for a while... Until I ran into an issue where I was getting the error message API returned an error: Error: The request does not have valid authentication credentials.
To resolve this I tried a bunch of different things from changing the SCOPES variable to commenting and uncommenting out things.
Eventually I deleted the project and credentials on my google developers console account and tried to make a new one.
Whenever I start a new folder from scratch, make a quickstart.js file, install the node modules and run it, now I get The API returned an error: Error: unauthorized_client. I've made completely new client_secret.json files and made the quickstart.js from scratch directly using the quickstart walkthrough code and it won't work. What could be causing this?
Link to github (this is the code that WAS mostly working until I tried to delete rows from my google sheet after copying data to my sql database).
You may want to try what was done in this SO post wherein this hidden file has been deleted:
/Users/user/.credentials/gmail-nodejs-quickstart.json
In your case, you need to locate the path of sheets.googleapis.com-nodejs-quickstart.json then delete.
For this, you might need to also do a console.log to locate the correct path.

Nagiosgraph onMouseOver not working

I had a nagios server monitoring several hosts and services. Now I've been asked to implement nagiosgraph. I've followed the documentation to the letter and everything worked except the mouse over function.
I created a common-header.ssi file with this code
<script type="text/javascript" src="/nagiosgraph/nagiosgraph.js"></script>
I've placed this file into my nagios path /usr/local/nagios/share/ssi
I've defined a service to work out with the mouse over function like this:
define service{
use local-service,graphed-service
host_name TOMCAT-DESARROLLO
service_description Tomcat heap memory
check_command check_nrpe!check_jmx_heap
notifications_enabled 0
action_url /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver="showGraphPopup(this)" onMouseOut="hideGraphPopup()" rel='/nagiosgraph/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$
}
Nagiosgraphs works properly, I can access graphs for a service clicking on the icon. When I mouse over the icon, a popup should show the graph without needing to click anywhere, but instead I get this error message in the console:
Uncaught ReferenceError: showGraphPopup is not defined
onmouseover # status.cgi?host=all:893
It seems to me that nagiosgraph is using the wrong cgi, since the command line states it would be using "showgraph.cgi" but the error is coming from nagios' "status.cgi".
Any ideas on why would this be happening and how to fix it?
Thanks a lot
I don't know if it is relevant to U any more, I battled with same issue for 2 days now and finally got it.
From Nagios: You can include custom headers and footers in the output of the CGIs by dropping some appropriately named HTML files in the ssi/ subdirectory of the Nagios HTML directory (i.e. /usr/local/nagios/share/ssi).
Not true! The format of the ssi files should be in bash not HTML. Meaning you should echo output. Example common-header.ssi:
#!/bin/bash
echo "<script type=\"text/javascript\" src=\"/nagiosgraph/nagiosgraph.js\"></script>"

"Uncaught TypeError: undefined is not a function" error only happens in production -- not in development

A weird bug has cropped up, and we're a little stumped.
The bug only appears in production -- not locally.
Every time a web page loads, it generates the following JavaScript error: "Uncaught TypeError: undefined is not a function."
The location for the code is in 3rd party code (i.e., Colorbox) which used to work fine before.
We use jQuery and Rails. Could this be related to the order in which Rails merges files into one mega JS file?
To reproduce and see the error, visit www.panabee.com. View the error in Firebug or in Chrome's Developer Tools. The error will crop up on the home page (awesome first impression).
Thanks for any help!
Line 10587 of all.zip.
* Date: Mon May 16 05:32:54 PDT 2011
*/"use strict",function(a,b,c){function z(b){
Change the , after the "use script" to a ; - Here the function def turned to be undefined due to a syntax problem.

Categories

Resources