Giter Site home page Giter Site logo

Comments (8)

tobilg avatar tobilg commented on June 2, 2024

Can you show the full code and the complete stacktrace?

from facebook-events-by-location-core.

emilwidlund avatar emilwidlund commented on June 2, 2024

Here's the code with the accessToken stripped out.

const httpstatus = require('http-status');
const EventSearch = require("facebook-events-by-location-core");
const es = new EventSearch();

module.exports = (app, options) => {
const repo = options.repo;

/*

=================================
GET - GET EVENTS
=================================

*/

app.get('/events', (req, res, next) => {
    if (req.query.longitude && req.query.latitude) {

        es.search({
            lat: parseFloat(req.query.latitude),
            lng: parseFloat(req.query.longitude),
            accessToken: //accessToken
        })
        .then((events) => {
            res.status(httpstatus.OK).json(events);
        })
        .catch((err) => {
            res.status(httpstatus.INTERNAL_SERVER_ERROR).json({errorMessage: 'Something went wrong when searching for nearby events'});
        });

    } else {
        res.status(httpstatus.BAD_REQUEST).json({errorMessage: 'Please specify longitude & latitude coordinates'});
    }

});
}

The thing is that I don't get the error object from the Catch-phase. So the TypeError is all that ends up in my console. I've double-checked and it looks like something is wrong within the lib itself.

from facebook-events-by-location-core.

tobilg avatar tobilg commented on June 2, 2024

Slightly off-topic, but why don’t you use https://github.com/tobilg/facebook-events-by-location as you’re apparently trying to build an API service?

from facebook-events-by-location-core.

emilwidlund avatar emilwidlund commented on June 2, 2024

Mainly because I have a quite big & complex API already setup, and I found that this repo would be the easiest way to get the functionality in.

from facebook-events-by-location-core.

emilwidlund avatar emilwidlund commented on June 2, 2024

After some digging, the problem seems to occur on line 124 in eventSearch.js. That success function never executes.

The most recent commit could have caused some issues. 25c2443

Version 0.7.0 works fine. Downgrading until issue is fixed.

from facebook-events-by-location-core.

tobilg avatar tobilg commented on June 2, 2024

I actually couldn't find a way to get it to error-ing out... Made some minor tweaks in #23. Tests pass.

from facebook-events-by-location-core.

tobilg avatar tobilg commented on June 2, 2024

New version 0.8.1 has been published to npm. Please check and close accordingly.

from facebook-events-by-location-core.

emilwidlund avatar emilwidlund commented on June 2, 2024

Thanks for such a quick solution. 0.8.1 works fine. Closing issue.

from facebook-events-by-location-core.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.