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

Returns undefined in React App #2

Open
wolfgang-terzer opened this issue Feb 12, 2019 · 1 comment
Open

Returns undefined in React App #2

wolfgang-terzer opened this issue Feb 12, 2019 · 1 comment

Comments

@wolfgang-terzer
Copy link

Hi,
I am trying to use the SDK in my react app. I use it in that way:

const IC = require('iatacodes');
const ic = new IC(iataCodesApiKey);

ic.api('autocomplete', {query: 'vie'}, function(error, response) {
    console.log(error);
    console.log(response);
  });

It returns "Undefined".
Error Text:

Error: empty response
    at Request._callback (index.js:36)
    at self.callback (request.js:220)
    at Request.push../node_modules/events/events.js.EventEmitter.emit (events.js:72)
    at Request.push../node_modules/request/request.js.Request.onRequestError (request.js:963)
    at push../node_modules/stream-http/lib/request.js.module.exports.push../node_modules/events/events.js.EventEmitter.emit (events.js:72)
    at request.js:162

What do I do wrong? Or has it an error?

Thanks for response.

@martimarkov
Copy link

This is connected to #3 and #1. The reason you are getting that error is because of an issue with the certificate. Before running the app add export NODE_TLS_REJECT_UNAUTHORIZED=0 and it should work but the certificate really needs to be fixed before you can ship the app.

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

2 participants