Skip to main content

Skipping duplicate osapi method definition friendconnect.js

By Sam Deering

JavaScript

Share:

😳 Ever felt a little embarassed sharing your JavaScript? Let's fix it.

This JavaScript error message was appearing when i included Google Friend Connect. It is very anoying so I decided to try and fix it.

This was the full error message:


Skipping duplicate osapi method definition chili.people.list on transport Googleapis; others may exist, but suppressing warnings
friendconnect.js (line 121)
Skipping duplicate osapi method definition pos.plusones.list on transport Googleapis; others may exist, but suppressing warnings
friendconnect.js (line 121)
Skipping duplicate osapi method definition chili.entities.starred.insert on transport Googleapis; others may exist, but suppressing warnings
friendconnect.js (line 121)
Skipping duplicate osapi method definition chili.entities.get on transport Googleapis; others may exist, but suppressing warnings
friendconnect.js (line 121)
Skipping duplicate osapi method definition chili.groups.list on transport Googleapis; others may exist, but suppressing warnings
friendconnect.js (line 121)
Skipping duplicate osapi method definition chili.activities.list on transport Googleapis; others may exist, but suppressing warnings
friendconnect.js (line 121)
Skipping duplicate osapi method definition chili.entitiesDefaultAcl.get on transport Googleapis; others may exist, but suppressing warnings
friendconnect.js (line 121)
Skipping duplicate osapi method definition Googleapis.newHttpRequest on transport Googleapis; others may exist, but suppressing warnings

If we inspect friendconnect.js line 121:

}if(j===a&&g.warn){g.warn(i)

Line 121 sits inside this function (the full Google connect script is loaded from here: http://www.Google.com/friendconnect/script/friendconnect.js):

function b(j,i){
	if(j



Solution

I google’d it and someone said to “Clear your browser cache, and try again”. This didn’t work for me and I highly suspect it’s a bug in google’s friend connect code.

Include only the following code from the full google friend connect code supplied by the google website to insert.

//PASTE BEFORE TAG (IN WORDPRESS HEADER.PHP CODE)




//PASTE INTO THE WIDGET AREA (IN WORDPRESS A TEXT WIDGET)

//PASTE BEFORE TAG (IN WORDPRESS FOOTER.PHP CODE)

Similar errors which this may also fix:
Unsafe JavaScript attempt to access frame with URL https://clients6.google.com/static/proxy.html
Uncaught TypeError: Cannot call method ‘tickDl’ of undefined

Sam Deering has 15+ years of programming and website development experience. He was a website consultant at Console, ABC News, Flight Centre, Sapient Nitro, and the QLD Government and runs a tech blog with over 1 million views per month. Currently, Sam is the Founder of Crypto News, Australia.

New books out now!

💁‍♀️ Fun Fact: Python was ranked #2 on a recent highest paid coders list. *


🤓 Ok. When did a code editor from Microsoft become kinda cool!?