Yes, the issue is that Modules.addCached is expecting a statement, but you were giving it an expression.
Modules.addCached
If you typed {ssid: "ssidVal"} at the console it'd fail too, because when it sees { it's expecting a block of code and not JSON.
{ssid: "ssidVal"}
{
To work around it, you can surround the JSON in brackets: ({ssid: "ssidVal"}) - but in this case it's not actually going to have the effect you want.
({ssid: "ssidVal"})
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes, the issue is that
Modules.addCached
is expecting a statement, but you were giving it an expression.If you typed
{ssid: "ssidVal"}
at the console it'd fail too, because when it sees{
it's expecting a block of code and not JSON.To work around it, you can surround the JSON in brackets:
({ssid: "ssidVal"})
- but in this case it's not actually going to have the effect you want.