naimo84/kalender-events

'getTime' of undefined error

Closed this issue · 2 comments

Hey im trying to use your package on my own server but im getting the following error Code:

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getTime' of undefined at KalenderEvents.convertEvent (/home/tom/node_modules/kalender-events/dist/lib.js:398:40) at KalenderEvents.convertEvents (/home/tom/node_modules/kalender-events/dist/lib.js:366:35) at KalenderEvents.<anonymous> (/home/tom/node_modules/kalender-events/dist/lib.js:547:51) at step (/home/tom/node_modules/kalender-events/dist/lib.js:33:23) at Object.next (/home/tom/node_modules/kalender-events/dist/lib.js:14:53) at fulfilled (/home/tom/node_modules/kalender-events/dist/lib.js:5:58) (node:860) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:860) [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.

This is my Code:

import { KalenderEvents } from "kalender-events";

const ev = new KalenderEvents({
url: "https://calendar.google.com/calendar/ical/............/basic.ics"
});

ev.getEvents({
type: 'ical',
preview: 10,
previewUnits:'days',
pastview: 10,
pastviewUnits:'days'
}).then(data => {
console.log(data);
})

Also when i try to run the code on runkit its reporting the error "Error: Cannot find module 'luxon'" - is there a connection between the errors?

Kind regards, Thomas

Hello Thomas,

I tried it right now with my Google calendar, and unfortunately it's working as expected... Can you perhaps send my the complete ics to git@naimo84.dev? Maybe I see the error.

Regards,
Benjamin

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.