Open ghost opened 6 years ago
@paul-tx This seems like an issue with the Cognito JS SDK. Can I see your package.json
?
Hi Jay, I’m not sure which project I was doing this for. One thing I know though is that I’m fastidious about always using the latest version of packages.
From: Jay V Sent: Friday, February 16, 2018 4:06 PM To: AnomalyInnovations/aws-api-gateway-cli-test Cc: paul-tx; Mention Subject: Re: [AnomalyInnovations/aws-api-gateway-cli-test] ReferenceError:fetch is not defined (#7)
@paul-tx This seems like an issue with the Cognito JS SDK. Can I see your package.json? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
I encountered a similar issue in another script I was building using amazon-cognito-identity-js library v2.0.0 on node v6.10.3 I was able to fix it by adding node-fetch npm to the project and setting a global for it. global.fetch = require('node-fetch');
@sw-waterford Did you add this to the index.js
https://github.com/AnomalyInnovations/aws-api-gateway-cli-test/blob/master/index.js?
This was in a different project/library if it was added to the index of this project it should be a suitable replacement for the WindowMock library. I have not encountered the issue with this module so I have not tried swapping them out.
I'm following the tutorial at: https://serverless-stack.com/chapters/test-the-apis.html
I'm using node v8.9.4 and the latest packages as of 2/12/2018
I get this error: