Can not load modules.json from userModules

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Can not load modules.json from userModules

Post by pz1 »

I am in the process of adapting my experimental weather module for multilingual texts. I closely modeled it after the latest OpenWeather example. I do get the following error message in the log:

Notification: error (core): Can not load modules.json from userModules/Wunderground/module.json: SyntaxError: Unexpected token }

More log

Code: Select all

[2015-03-04 14:22:39.589] [I] [core] Executing script: /*** Main Automation webserver module ***************************************** ...
[2015-03-04 14:22:39.591] [I] [core] Executing script: // Make this testable by pulling in underscore from the parent module ...
[2015-03-04 14:22:39.595] [I] [core] Executing script: /*** Main Automation storage module ***************************************** ...
[2015-03-04 14:22:39.608] [I] [core] --- Loading ZAutomation classes
[2015-03-04 14:22:39.684] [I] [core] Notification: error (core): Can not load modules.json from userModules/Wunderground/module.json: SyntaxError: Unexpected token }
[2015-03-04 14:22:39.710] [I] [core] SyntaxError: Unexpected token }
    at AutomationController.loadModuleFromFolder (automation/classes/AutomationController.js:225:29)
    at automation/classes/AutomationController.js:196:14
    at Array.forEach (native)
    at AutomationController.loadModules (automation/classes/AutomationController.js:195:37)
    at AutomationController.init (automation/classes/AutomationController.js:69:10)
    at automation/main.js:304:16
[2015-03-04 14:22:39.712] [I] [core] Starting ZWay Automation webserver
[2015-03-04 14:22:39.718] [I] [core] Loading modules...
[2015-03-04 14:22:39.724] [I] [core] Loading module SensorValueLogging from modules/SensorValueLogging
[2015-03-04 14:22:39.726] [I] [core] Executing script: /*** SensorValueLogging Z-Way Home Automation module ************************************* ...
[2015-03-04 14:22:39.729] [I] [core] Loading module OpenRemoteHelpers from modules/OpenRemoteHelpers
[2015-03-04 14:22:39.731] [I] [core] Executing script: /* RaZOR ...
I have looked at the code of both OpenWeather and my Wunderground side by side several times, but fail to spot the differences that would explain my problem. JS code passed online Lint test. So far I have only prepared the language/en.json file.
Attachments
Wunderground.zip
(6.7 KiB) Downloaded 215 times
Since 29-12-2016 I am no longer a moderator for this forum
dolpheen
Posts: 119
Joined: 10 Feb 2015 00:38

Re: Can not load modules.json from userModules

Post by dolpheen »

Bad comma at the end :)

Code: Select all

"source": {
				"type": "select",
				"enum": ["JSON", "XML"],
				"required": true
			},
P.S. For quick test I used

Code: Select all

/JS/Run/fs.loadJSON('userModules/Wunderground/module.json')
Razberry B+ 2.0.1-rc25 on ZW500 + 15 devices / Razberry B 2.0.1-rc25 on ZW300 for test
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Can not load modules.json from userModules

Post by pz1 »

Thanks for the quick reply, it works fine now. I do appreciate the mentioning of the quick test. Really helpful.
Post Reply