TypeError: google.visualization.GadgetHelper is not a constructor

38 views
Skip to first unread message

Pandurang Yachwad

unread,
Jun 19, 2020, 5:16:28 PM6/19/20
to Google Visualization API
While embedding the gadget in the google site, getting error as "TypeError: google.visualization.GadgetHelper is not a constructor". Incidentally it was working till recently but stopped working since few days back.

var queryString = prefs.getString("_table_query_url"); 
var gadgetHelper;

// Register our on-load handler for this gadget.
gadgets.util.registerOnLoadHandler(init);

// Entry point for our gadget. 
function init() {
    loadVisualizationAPI();
}

// Load the API we are using and kickoff a query. 
function loadVisualizationAPI() {
    google.load('visualization', '1', {'packages': ['table']});
    google.setOnLoadCallback(sendQuery);
}

// Send and handle a query. 
function sendQuery() { 
    gadgetHelper = new google.visualization.GadgetHelper();
    var query = gadgetHelper.createQueryFromPrefs(prefs);
    query.setQuery('select *');
    query.send(handleQueryResponse);
}

Daniel LaLiberte

unread,
Jun 19, 2020, 8:09:41 PM6/19/20
to Google Visualization API
The jsapi loader is now being redirected to the new loader.  You should update how you load the library, as documented here:   https://developers.google.com/chart/interactive/docs/basic_load_libs#update-library-loader-code

Also, the GadgetHelper was removed, though it is still documented.   I'm not sure we can bring it back, due to security concerns, but I'll look into it. In the meantime, you should be able to load version '47' to see the previous behavior.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/6b5e3983-92ef-430c-9371-3a819152b69eo%40googlegroups.com.


--

Pandurang Yachwad

unread,
Jun 20, 2020, 1:19:35 AM6/20/20
to Google Visualization API
Thank you Daniel for quick response and updates about load library. 

I tried updating the library but still getting error with GadgetHelper even with version 47. Could you let me know any way to work with GadgetHelper? if not, what's the alternative to it?


On Friday, June 19, 2020 at 7:09:41 PM UTC-5, Daniel LaLiberte wrote:
The jsapi loader is now being redirected to the new loader.  You should update how you load the library, as documented here:   https://developers.google.com/chart/interactive/docs/basic_load_libs#update-library-loader-code

Also, the GadgetHelper was removed, though it is still documented.   I'm not sure we can bring it back, due to security concerns, but I'll look into it. In the meantime, you should be able to load version '47' to see the previous behavior.

On Fri, Jun 19, 2020 at 5:16 PM Pandurang Yachwad <panduran...@gmail.com> wrote:
While embedding the gadget in the google site, getting error as "TypeError: google.visualization.GadgetHelper is not a constructor". Incidentally it was working till recently but stopped working since few days back.

var queryString = prefs.getString("_table_query_url"); 
var gadgetHelper;

// Register our on-load handler for this gadget.
gadgets.util.registerOnLoadHandler(init);

// Entry point for our gadget. 
function init() {
    loadVisualizationAPI();
}

// Load the API we are using and kickoff a query. 
function loadVisualizationAPI() {
    google.load('visualization', '1', {'packages': ['table']});
    google.setOnLoadCallback(sendQuery);
}

// Send and handle a query. 
function sendQuery() { 
    gadgetHelper = new google.visualization.GadgetHelper();
    var query = gadgetHelper.createQueryFromPrefs(prefs);
    query.setQuery('select *');
    query.send(handleQueryResponse);
}

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

Daniel LaLiberte

unread,
Jun 20, 2020, 11:54:05 AM6/20/20
to Google Visualization API
My mistake.  Version 47 already included the deletion.  But there are several older versions available.  See https://developers.google.com/chart/interactive/docs/release_notes#official-releases

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/9d6e7c2c-16ef-4898-b036-7c8a8ee95dddo%40googlegroups.com.

Pandurang Yachwad

unread,
Jun 21, 2020, 1:14:35 AM6/21/20
to google-visua...@googlegroups.com
Thank you Daniel, I tried with version 41 and it worked.

Thank you again for your help.

Thanks,
Pandurang Yachwad


Reply all
Reply to author
Forward
0 new messages