-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot load SDK into Google Apps Script #620
Comments
The AWS SDK distributable relies on the existence of the Let me know if this helps. |
I'm looking to just create a stand-alone Google Apps Script (GAS) that uses the built-in GAS "Time-driven" Events trigger. Let me know if this is possible, or if there are work-arounds to deal with the lack on the window object. |
It seems like the article you posted provides a number of workaround to include libraries in your code:
And also:
Did you try either of these methods? Note that loading the AWS SDK should be equivalent to the methodology required to load Underscore that is described in that post. Specifically, both libraries rely on a global variable attached to It's hard for us to know what exactly is not working without seeing code. If you're still having trouble, it would help if you showed the code that you are using to load both Underscore and the AWS SDK in your application. Hope that helps. |
@clemesha I gave this a shot and was able to load the SDK with minimal adjustment to the aws-sdk.js file: (function(){var window = {};
// PASTE THE AWS SDK CODE HERE
;this.AWS = window.AWS;}).call(this); The Note that although the SDK might "load", there is no guarantee that the SDK will function correctly, as it does depend on other properties exported in your JavaScript environment (like XMLHttpRequest). It does look like GAS provides a non-standard JavaScript environment that is currently not natively supported by the SDK. Following the suggestion by @AdityaManohar to run inside of an HTML partial and run it in EMULATED mode might be a better approach than trying to load it natively. Hope that helps! |
Yes, these are unlikely to have a workaround. See the second paragraph in my last response. Most notably, GAS has no native support for XHR, which is integral to the correct functioning of the SDK. |
Ok, understood. Thanks again @AdityaManohar and @lsegal ! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Hi,
I'm currently writing a simple service using https://developers.google.com/apps-script/
and I cannot get the SDK to load. I'm currently working with aws-sdk-2.1.32.
I've followed these steps:
http://googleappsdeveloper.blogspot.com/2012/11/using-open-source-libraries-in-apps.html
and still haven't got it to work.
I have tested the above method to load 'underscore.js', and that is working.
I can provide any other details or run any tests, just let me know.
Thank you.
The text was updated successfully, but these errors were encountered: