cljsjs / packages

DEPRECATED: Javascript libraries packaged up with Google Closure externs
http://cljsjs.github.io
787 stars 816 forks source link

AWS SDK JS: Node support #554

Open simshanith opened 8 years ago

simshanith commented 8 years ago

The cljsjs/aws-sdk-js does not appear to support Node runtime. In fact, it uses the browser dist build only, and does not offer the Node library at all.

Was able to get it the browser version working partially via the following hacks (not recommended):

(ns example.self
  "Sets js/self as js/global. Required for aws-sdk-js usage.")
(set! js/self js/global)
(ns example.aws
  (:require [example.self]
            [cljsjs.aws-sdk-js]))
(ns example.core
  (:require [example.aws])

(println js/AWS)

However, as previously mentioned, this is the browser version of the SDK, and does not automatically grab credentials from IAM role, environment variables, local credentials file, etc. This makes it a non-starter for my project.

arichiardi commented 7 years ago

To add to that, I have tried it in lumo, getting the error:

#error {:message Could not require cljsjs.aws-sdk-js, :data {:tag :cljs/analysis-error}, :cause #object[TypeError TypeError: Cannot read property 'crypto' of undefined]}