Jeremy,
Following up on this, I believe I have imported the module without issue (verified by checking the index.js output of ``--build lambda`` ).
However, testing the Lambda in AWS still throws an error.
It seems the issue is that my javascript macro which makes the AJAX call is actually just using the built-in httprequest capability within TW5. As such, the AWS console is telling me the variable is undefined in a bunch of tiddlers (tiddlers listed at the bottom of this message).
So, forgive me if this is a bit of a newbie question, but how would I go about making the variable definition global so that TW itself has a definition for this type of request?
I was thinking it might make sense to just define it in each of the tiddlers individually... but my macro has this definition and somehow still ends up listed here... (it's possible I have not defined it correctly).
--
Here's the AWS error with tiddlers using httprequest (note $:/sandbox/myjax_json.js is my javascript macro... it works well in the browser):
{
"errorType": "ReferenceError",
"errorMessage": "XMLHttpRequest is not defined",
"trace": [
"ReferenceError: XMLHttpRequest is not defined",
" at Object.exports.httpRequest ($:/core/modules/utils/dom/http.js:27:13)",
" at MacroCallWidget.exports.run ($:/sandbox/myjax_json.js:42:13)",
" at MacroCallWidget.Widget.evaluateMacroModule ($:/core/modules/widgets/widget.js:215:21)",
" at MacroCallWidget.Widget.getVariableInfo ($:/core/modules/widgets/widget.js:133:14)",
" at MacroCallWidget.execute ($:/core/modules/widgets/macrocall.js:52:23)",
" at MacroCallWidget.render ($:/core/modules/widgets/macrocall.js:32:7)",
" at Widget.renderChildren ($:/core/modules/widgets/widget.js:390:15)",
" at Widget.render ($:/core/modules/widgets/widget.js:75:7)",
" at $tw.Wiki.exports.renderTiddler ($:/core/modules/wiki.js:1054:13)",
" at Command.subCommands.s3-rendertiddler ($:/plugins/tiddlywiki/aws/command.js:110:33)"
]
}
Phil