Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a fix for the Unhandled promise error, in TcpSockets.js . Can someone help me with this? #104

Open
SuryaChandrasekaran opened this issue Jun 10, 2019 · 3 comments

Comments

@SuryaChandrasekaran
Copy link

node_modules\react-native-tcp\TcpSockets.js:16
exports.createServer = function(connectionListener : (socket: Socket) => void) : Server {
^

SyntaxError: Unexpected token :
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Module._compile (C:\react workspace\twilioSMS\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Object.newLoader [as .js] (C:\react workspace\twilioSMS\node_modules\pirates\lib\index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
(node:6012) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6012) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate
the Node.js process with a non-zero exit code.

@braksator
Copy link

I had the same problem. It seems those .js files in this project are written in typescript. I installed a module that lets react-native comprehend typescript automatically and that seems to have sorted it out. https://github.com/ds300/react-native-typescript-transformer

@phillbaker
Copy link

A maintained fork is over at https://github.com/aprock/react-native-tcp (I help to maintain it).

I'd like to help get this sorted out - we use this package as a dependency, and don't use typescript. It seems like this should be a pretty common problem, I'm confused how it doesn't pop up more.

@SuryaChandrasekaran
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants