aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.59k stars 1.55k forks source link

UnhandledPromiseRejectionWarning #1439

Closed pfirmin closed 7 years ago

pfirmin commented 7 years ago

I have to admit I am new too react-native projects. I am trying to test connecting to a dynamodb with the latest aws-sdk js. I keep getting the following error:

_(node:10215) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 819): UnableToResolveError: Unable to resolve module events from .../ReactProjects/AWSConnect/node_modules/aws-sdk/lib/http/xhr.js: Module does not exist in the module map or in these directories: .../ReactProjects/AWSConnect/node_modules/aws-sdk/node_modules , .../ReactProjects/AWSConnect/nodemodules

if I restart and run-ios again I get essentially the same error:

_(node:10377) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 819): UnableToResolveError: Unable to resolve module util from ..../ReactProjects/AWSConnect/node_modules/aws-sdk/lib/event_listeners.js: Module does not exist in the module map or in these directories: ..../ReactProjects/AWSConnect/node_modules/aws-sdk/node_modules , .../ReactProjects/AWSConnect/nodemodules

To reproduce the error: 1) I create the most basic react-native project on ios 2) run "npm install aws-sdk" (I have also tried with yarn and I have also tried older version by updating my package.json file with older version numbers) 3) in my main App.js file or in index.ios.js (Default) I add the dependancy var AWS = require('aws-sdk'); 4) without adding anything else I get the error above when I run "react-native run-ios"

Out of interest if it matters, here is how aws-sdk is listed in my package.json file. "dependencies": { "aws-sdk": "^2.34.0", "react": "15.4.2", "react-native": "0.42.3" },

Please let me know what I am doing wrong because I assume this is working for other people.

Thanks,

chrisradek commented 7 years ago

@pfirmin The SDK doesn't currently work with react-native. We have a PR up to add support, but need to work on our testing/deployment strategy before merging it in: https://github.com/aws/aws-sdk-js/pull/1393

Take a look at that PR, the README gives instructions on how to try out the SDK. Also would love any feedback you can give about the SDK in react-native.

chrisradek commented 7 years ago

Closing in favor of #740

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.