I hit an odd bug when setting up a streambot lib that requires the aws-sdk for kms, but if aws-sdk is declared in the package.json I get a Cannot find module 'xmlbuilder' error bubbling up from the aws-sdk. This occurs even after investigating the bundle.zip and finding that aws-sdk with the xmlbuilder module is installed correctly.
If aws-sdk is removed from package.json, aws-sdk still is installed into the node_modules folder in bundle.zip because of https://github.com/mapbox/streambot/blob/master/bin/bundle#L24. I still see an error in the lambda logs, but it's changed to something like cannot find index (actual log has been lost. Seems that when you change the event source it clears the logs -- logs are stored by shardId and it looks like previous logs were overwritten).
If I make sure that there is no aws-sdk installed in bundle.zip, everything works fine.
Maybe this has something to do with:
the current version of the AWS SDK is pre-installed in Lambda
and bad interactions between versions? Perhaps this case only occurs when deploying a lambda function that requires aws-sdk directly.
cc @mick @rclark
I hit an odd bug when setting up a streambot lib that requires the aws-sdk for kms, but if
aws-sdkis declared in thepackage.jsonI get aCannot find module 'xmlbuilder'error bubbling up from theaws-sdk. This occurs even after investigating thebundle.zipand finding thataws-sdkwith thexmlbuildermodule is installed correctly.If
aws-sdkis removed frompackage.json,aws-sdkstill is installed into the node_modules folder inbundle.zipbecause of https://github.com/mapbox/streambot/blob/master/bin/bundle#L24. I still see an error in the lambda logs, but it's changed to something likecannot find index(actual log has been lost. Seems that when you change the event source it clears the logs -- logs are stored by shardId and it looks like previous logs were overwritten).If I make sure that there is no
aws-sdkinstalled inbundle.zip, everything works fine.Maybe this has something to do with:
and bad interactions between versions? Perhaps this case only occurs when deploying a lambda function that requires
aws-sdkdirectly.cc @mick @rclark