nativescript-nodeify
nativescript-nodeify copied to clipboard
AWS Amplify Support
Has anyone successfully gotten nodeify working with AWS Amplify? I'm attempting to use the library but am getting JS ERROR ReferenceError: Can't find variable: Buffer
Any help would be great!
Does this comment help?
@EddyVerbruggen thank you for the quick response!
Unfortunately, I don't think that comment helps. I'm already importing the plugin before use of Amplify.

Are there any additional steps I should be taking?
@collindutter Have you tried actually require
-ing? require("nativescript-nodeify");
-- I mean, depending on your buildsystem and whether or not you're using the imported Nodeify
var the require
may not even end up in the generated .js file.
Getting the same issue with

Can you share a repro so I can take a look?
When configured on a fresh project, I get Can't find variable: window
. Here is the project: https://github.com/collindutter/NodeifyAmplify
Thanks for the help!
EDIT:
Just to clarify, I'm including the library in auth.service.ts. When I include nodeify with import * as Nodeify from 'nativescript-nodeify;
I get Can't find variable: Buffer
. But when I include nodeify with require('nativescript-nodeify');
I get Can't find variable: window
.
Not sure how much this helps, but it looks like people using react and rn-nodeify were able to get it working https://github.com/aws/aws-amplify/issues/140
@EddyVerbruggen were you able to find anything in the repo I linked?
anyone found the working solution for aws-amplify
I am not getting same error message but the different one
navigator is not defined
Getting this message when trying to call "
Amplify.configure()
"
ERROR Error: Uncaught (in promise): ReferenceError: navigator is not defined
JS: ReferenceError: navigator is not defined
JS: at standardBrowserEnv (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/helpers/isURLSameOrigin.js:11:39)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/helpers/isURLSameOrigin.js:60:5)
JS: at require (<anonymous>:1:266)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/adapters/xhr.js:7:23)
JS: at require (<anonymous>:1:266)
JS: at getDefaultAdapter (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/defaults.js:20:15)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/defaults.js:29:12)
JS: at require (<anonymous>:1:266)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/core/Axios.js:3:16)
JS: at require (<anonymous>:1:266)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/axios.js:5:13)
JS: at require (<anonymous>:1:266)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/index.js:1:78)
JS: at require (<anonymous>:1:266)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/aws-amplify/lib/API/RestClient.js:70:15)
Successfully synced application org.nativescript.awsamplify on device 3421353f0604.
ActivityManager: Start proc 17292:org.nativescript.awsamplify/u0a341 for activity org.nativescript.awsamplify/com.tns.NativeScriptActivity
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ERROR Error: Uncaught (in promise): ReferenceError: navigator is not defined
JS: ReferenceError: navigator is not defined
JS: at standardBrowserEnv (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/helpers/isURLSameOrigin.js:11:39)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/helpers/isURLSameOrigin.js:60:5)
JS: at require (<anonymous>:1:266)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/adapters/xhr.js:7:23)
JS: at require (<anonymous>:1:266)
JS: at getDefaultAdapter (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/defaults.js:20:15)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/defaults.js:29:12)
JS: at require (<anonymous>:1:266)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/core/Axios.js:3:16)
JS: at require (<anonymous>:1:266)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/lib/axios.js:5:13)
JS: at require (<anonymous>:1:266)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/axios/index.js:1:78)
JS: at require (<anonymous>:1:266)
JS: at Object.<anonymous> (file:///data/data/org.nativescript.awsamplify/files/app/tns_modules/aws-amplify/lib/API/RestClient.js:70:15)
Changed it to "aws-amplify": "^0.2.9" version and everything working fine now :)
just getting few warning messages only
Changed it to "aws-amplify": "^0.2.9" version and everything working fine now :)
just getting few warning messages only
Are you still using aws-amplify
along with nativescript-nodeify
? And if yes, have you been able to get it to work with a newer version of aws-amplify
as we're now on 1.+?
@envisean yes it’s working fine with latest amplify version.
Hello guys, can any of you explain to me how did you get it to work with Amplify v3?
I am having the window
is not defined error for ages now, and I cannot find how to define it. Should I create a shim or how?
@collindutter Did you arrive to a solution?
@diegovincent sorry I dropped this a couple years ago. I don't think I ever reached a solution myself.
@collindutter
Oh no! I hope it turned out ok!
Well, thanks for posting it anyways, if by any chance you are interested, leave a like at my message here so maybe we can attract developers of the community to solve this important issue (I think "officially" supporting AWS is a pressing matter if we want people to adopt and improve the NativeScript community and technology).
Thanks for your fast reply! And good luck with your projects.
D.
@diegovincent Just dropped a like, best of luck!
@collindutter could you re-open it?