mrVragec / MMM-mvgmunich

MagicMirror² Module to monitor public transport (U-bahn, tram, bus, S-Bahn) in Munich
MIT License
27 stars 10 forks source link

Unexpected token < in JSON #46

Open MartinS419 opened 3 years ago

MartinS419 commented 3 years ago

Hi, despite a second install Fresh as You described in issue https://github.com/mrVragec/MMM-mvgmunich/issues/43#issuecomment-757474217 I am still not getting any data, npm start results in the following error: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at Request._callback (/home/pi/MagicMirror/modules/mvgmunich/node_helper.js:59:31) at Request.self.callback (/home/pi/MagicMirror/node_modules/request/request.js:185:22) at Request.emit (events.js:315:20) at Request.<anonymous> (/home/pi/MagicMirror/node_modules/request/request.js:1154:10) at Request.emit (events.js:315:20) at Gunzip.<anonymous> (/home/pi/MagicMirror/node_modules/request/request.js:1076:12) at Object.onceWrapper (events.js:421:28) at Gunzip.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1220:12)

A JSOn check of request.js retrieves that: Parse error on line 1: 'use strict'var ht ^ Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'

Any idea how to fix that? Thanks

mrVragec commented 3 years ago

Would be possible to check the following:

Thank you!

MartinS419 commented 3 years ago

OS: PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" Node: node --version v10.24.1 MM: > magicmirror@2.15.0 start

Internet is stable and alive This error appears: Error while parsing and sending departure info SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at Request._callback (/home/pi/MagicMirror/modules/mvgmunich/node_helper.js:59:31) at Request.self.callback (/home/pi/MagicMirror/modules/mvgmunich/node_modules/request/request.js:185:22) at Request.emit (events.js:315:20) at Request.<anonymous> (/home/pi/MagicMirror/modules/mvgmunich/node_modules/request/request.js:1154:10) at Request.emit (events.js:315:20) at IncomingMessage.<anonymous> (/home/pi/MagicMirror/modules/mvgmunich/node_modules/request/request.js:1076:12) at Object.onceWrapper (events.js:421:28) at IncomingMessage.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1220:12)

Any ideas? I really would like to support my wife in getting her bus... :-) Thanks

mrVragec commented 3 years ago

Hi Martin,

would be possible to update your node version?

This is what I'm running and it's working fine.

dietpi@mirrorPi:~$ node --version
v13.9.0

If I'm not wrong, I face the same issue couple of months ago, and I just updated the node and reinstall MM dependencies. Maybe you already did something of this?

MartinS419 commented 3 years ago

Hi Mr. Vragec,

would be possible to update your node version?

thanks, this solved the issue of the unexpected token. Sadly i am now receiving an "undefined" in the modul section without further error message.

module: "mvgmunich", position: "top_left", header: "MVG", config: { haltestelle: "Hauptbahnhof", maxEntries: 5, // 10 items on screen updateInterval: 60000, // 60 s showIcons: true, // Show transport type icon transportTypesToShow: { "ubahn": true, // show ubahn route "sbahn": true, // show sbahn route "bus": true, // show bus route "regional_bus": true, // show regional bus route "tram": true // show tram route }, ignoreStations: [], // lines with destination to which should not be shown lineFiltering: { "active": false, // set this to active if filtering should be used "filterType": "whitelist", // whitelist = only specified lines will be displayed, blacklist = all lines except specified lines will be displayed "lineNumbers": ["U1", "U3", "X50"] // lines that should be on the white-/blacklist }, timeToWalk: 0, // 10 min walking time to station. Default is 0 showWalkingTime: false, // if the walking time should be included and the starting time is displayed showTrainDepartureTime: true, // show tran departure time trainDepartureTimeFormat: "relative", // format of the train departure time walkingTimeFormat: "relative", // format of the walking time showInterruptions: true, // show interruptions as gray-out rows showInterruptionsDetails: false, // show details of interruptions in next line countInterruptionsAsItemShown: false, // count interruptions details lines as a line shown } },

May I ask if You could trace the error? Thanks!

mrVragec commented 3 years ago

Hi @MartinS419

sorry for my late answer! Are you running the latest version of MM with the latest version of all the plugins?