I am trying to use AWS S3 via aws-sdk in my Ionic 2 project.
I have imported the aws-sdk typings using this method https://ionicframework.com/docs/v2/resources/third-party-libs/
npm install @types/aws-sdk --save
then I import it in a service:
import { S3 } from 'aws-sdk';
I can see all of the available AWS services from the typing (S3, DynamoDB, Lambda, etc) so I know that the aws-sdk typings are being recognized.
However, when I go to run the app on my iPhone from Xcode I get a white screen.
I get no errors during
ionic build ios
When I do remote debugging I get an error in the console that says
Error: Cannot find module "aws-sdk" main.js:57800
I’ve tried adding
declare module aws-sdk;
to declarations.d.ts
But then I get an error saying that it cannot find S3. Also when I go back to import on my service I no longer get a list of available services like I did without this declare statement.
I’m just not sure where else I need to declare aws-sdk in my project so that it gets properly transpiled in JS.
Thanks for the help…any other options for using AWS S3 in ionic 2 would also be greatly appreciated.
Cheers!