Syntax error in documentation for using context

A small note on a minor mistake.The node red documentation is great. So therefore a small feedback on what seems to be a minor systax error, bit it took me sometime to figure out what was srong when I wanted to enable this file context storage.

As a stand alone object, not having the comma is correct but in settings.js it should have a coma at the end. If you look in a fresh settings.js file you will see it has a comma.

How do you think the documentation should be changed?

I changed settings.js according the node red documentation and after reboot the node red didn't start. I noticed in the funtion node that the curly brackets were red and found the same descibtion here, but with the comma

"Syntax error in documentation for using context"

I added the comma and after that node red started without any issues by reboot. That is just how it worked for me. I might be wrong and the comma is not needed. I tried only once and something else may have caused the node red not to start, but It was the only change I made.

Sorry, was found here "Preserving variables in NodeRED - NotEnoughTech"

That's one of the great things about node red, there are so many good sources for support available online.

I tried again to remove the comma

Here without comma

Below verions is working. the one above not

The settings file needs to be valid javascript. Each property of the settings object has to be separated by a comma. So unless this is the last property in the settings block, you will need a comma after it.

I think the comma should be added in the documentation here

"Working with context : Node-RED"

1 Like

Thanks to both of you. I understand it now :slight_smile:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.