hovancik/later-on

Error in console (Node16)

Closed this issue · 3 comments

$ lateron 
22:37:03.011 › Starting Do Not Disturb monitoring
22:37:03.023 › Can't parse [object Object]. Must have 'type' of 'once', 'repeat' or 'cron'.
22:37:03.031 › Updating tray
(node:28960) UnhandledPromiseRejectionWarning: Error: Missing schedule definition.
    at Object.later.schedule (/opt/LaterOn/resources/app.asar/node_modules/@breejs/later/lib/index.js:712:21)
    at Object.later.setTimeout (/opt/LaterOn/resources/app.asar/node_modules/@breejs/later/lib/index.js:964:17)
    at Object.later.setInterval (/opt/LaterOn/resources/app.asar/node_modules/@breejs/later/lib/index.js:1008:17)
    at Reminder._schedule (/opt/LaterOn/resources/app.asar/reminder.js:43:26)
    at new Reminder (/opt/LaterOn/resources/app.asar/reminder.js:15:10)
    at Executor.planSchedules (/opt/LaterOn/resources/app.asar/executor.js:21:19)
    at /opt/LaterOn/resources/app.asar/main.js:69:12
(Use `lateron --trace-warnings ...` to show where the warning was created)
(node:28960) 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:28960) [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.

ok after adding 1st reminder (and app restart) error is replaced with

$ lateron 
22:42:47.052 › Starting Do Not Disturb monitoring
22:42:47.064 › Succesfully parsed '62de2c7c-f0ed-4723-9c00-34b4785da22e' as 'every 5 min'
22:42:47.067 › Error parsing 'ec0da237-1a3b-4a3a-a3cd-a5b7f70f26e1' at character 1 of '1'
22:42:47.068 › Error parsing '62de2c7c-f0ed-4723-9c00-34b4785da22e' at character 1 of '1000'
22:42:47.099 › Updating tray
(node:29887) UnhandledPromiseRejectionWarning: TypeError: next.map is not a function
    at Reminder.get upcomingReminders [as upcomingReminders] (/opt/LaterOn/resources/app.asar/reminder.js:96:17)
    at /opt/LaterOn/resources/app.asar/executor.js:96:19
    at Array.map (<anonymous>)
    at Executor.get upcomingReminders [as upcomingReminders] (/opt/LaterOn/resources/app.asar/executor.js:95:27)
    at updateTray (/opt/LaterOn/resources/app.asar/main.js:136:23)
    at /opt/LaterOn/resources/app.asar/main.js:118:3
(Use `lateron --trace-warnings ...` to show where the warning was created)
(node:29887) 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:29887) [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.
22:42:47.383 › Checking for new version (local: v0.1.0, remote: v0.1.0)

and there's no menu in later on:

image

I would go with node specified in package.json, as mentioned elsewhere. What is the data you are adding to the config? Error says it can't be parsed.

right it's because unparsed values (I first tried entering 1 and 1000 cause though they're in seconds or ms) were saved to the config...