The function doesn't seem to be available. Sample code:
const Amplify = require('aws-amplify')
Amplify.configure({
foo: 'bar'
})
Steps to reproduce: create a fresh node project, and add the code from above in index.js
. It will crash saying TypeError: Amplify.configure is not a function
.
If I do Amplify.default.configure
it works but this warning pops out:
[WARN] 00:51.431 Cache - getItem failed! TypeError: Cannot read property 'getItem' of null
@PaulRBerg Did you resolve this issue? I am having the same issue.
I have overlooked the fact that this is a frontend library, so it cannot (and should not) be used in node.
If someone is interested, there is still workaround to use it in Node. It should be:
Amplify.default.configure(..)
and requires support of fetch
, e.g
global.fetch = require('node-fetch');
Is it possible to use this with Lambda? I'm using node-fetch and Amplify.default.configure - it resolved my TypeError issue, but now I'm getting "window is not defined". Is Amplify just not meant to be used with Lambda?
We could do it, but only with some fixed old versions of amplify. It's an
ugly hack. I really hope that aws will introduce sdk methods to run queries
from lambdas
On Fri, Sep 28, 2018, 5:47 PM Sam notifications@github.com wrote:
Is it possible to use this with Lambda? I'm using node-fetch and
Amplify.default.configure - it resolved my TypeError issue, but now I'm
getting "window is not defined". Is Amplify just not meant to be used with
Lambda?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/aws-amplify/amplify-js/issues/443#issuecomment-425479041,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABXCH85u7WkxCQDjYS403xjVlIbXayp6ks5ufkSggaJpZM4SpFOG
.
has anyone found a solution for with lamda
Most helpful comment
If someone is interested, there is still workaround to use it in Node. It should be:
and requires support of
fetch
, e.g