Closed se7en241 closed 3 years ago
which node version do you have? You can check it by typing the following into you preferred shell.
node -v
it is 6.10
handing the parameters in the following way, seems to work as a work around:
return this._request(
'getTimetable',
{
options: {
id: new Date().getTime(),
element: {
id,
type
},
startDate:additionalOptions.startDate,
endDate:additionalOptions.endDate,
showLsText: true,
showStudentgroup: true,
it is 6.10
You need at minimum v8.3 in order to use the spread operator for rest (the …
thing). But I recommend you to use at minimum v14.x because it’s the current LTS version.
Thanx
Hi, I am using the WebUntis plugin as part of a module of the magic mirror and it is throwing error like this: /home/pi/MagicMirror/modules/MMM-untis/node_modules/webuntis/index.js:233 ...additionalOptions, ^^^ SyntaxError: Unexpected token ... at Object.exports.runInThisContext (vm.js:78:16) at Module._compile (module.js:543:28) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (/home/pi/MagicMirror/modules/MMM-untis/node_helper.js:2:15)
at Object. (/home/pi/MagicMirror/modules/MMM-untis/node_helper.js:132:3)
If I "correct" the syntax by removing the "..." then the code works, but the timetable request is not considering the range provided by additionalOptions.startDate and additionalOptions.endDate: async _timetableRequest(id, type, startDate, endDate, validateSession = true) { const additionalOptions = {}; if (startDate) { additionalOptions.startDate = this.convertDateToUntis(startDate); } if (endDate) { additionalOptions.endDate = this.convertDateToUntis(endDate); }
Any idea how to fix it? Regards se7en241