# Syntax error in documentation for using context

**URL:** <https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529>\
**Category:** General\
**Created:** [13 August 2023 09:58 UTC](https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529 "2023-08-13T09:58:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BJM](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@BJM](https://discourse.nodered.org/u/BJM)\
**Post date:** [13 August 2023 09:58 UTC](https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529/1 "2023-08-13T09:58:49Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/d/4d7942c653de552164375467f924c95a404bfd32.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 August 2023 10:14 UTC](https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529/2 "2023-08-13T10:14:07Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![BJM](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@BJM](https://discourse.nodered.org/u/BJM)\
**Post date:** [13 August 2023 10:27 UTC](https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529/3 "2023-08-13T10:27:27Z")

</div>

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](http://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529)"

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/d/1db136af98146f735d4d8953dac7b3ed0277fb5b.png)

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.

---

<div class="post-metadata">

**Author:** ![BJM](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@BJM](https://discourse.nodered.org/u/BJM)\
**Post date:** [13 August 2023 10:31 UTC](https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529/4 "2023-08-13T10:31:06Z")

</div>

Sorry, was found here "[Preserving variables in NodeRED - NotEnoughTech](http://notenoughtech.com/home-automation/preserving-variables-in-nodered/)"

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

---

<div class="post-metadata">

**Author:** ![BJM](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@BJM](https://discourse.nodered.org/u/BJM)\
**Post date:** [13 August 2023 10:40 UTC](https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529/5 "2023-08-13T10:40:40Z")

</div>

I tried again to remove the comma

Here without comma

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/4/b460bdd0359a423c1eaee9886cf70ce851373c0d.png)

Below verions is working. the one above not

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1b25b36c759a03c91d6a67477a9f25fb3974f11e.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [13 August 2023 10:43 UTC](https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529/6 "2023-08-13T10:43:58Z")

</div>

> [@BJM](#):
>
> I tried again to remove the comma

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.

---

<div class="post-metadata">

**Author:** ![BJM](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@BJM](https://discourse.nodered.org/u/BJM)\
**Post date:** [13 August 2023 10:44 UTC](https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529/7 "2023-08-13T10:44:28Z")

</div>

I think the comma should be added in the documentation here

"[Working with context : Node-RED](http://nodered.org/docs/user-guide/context)"

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/a/fa041f350b3502bcfd11a2eb40304636e286ebc5.png)

---

<div class="post-metadata">

**Author:** ![BJM](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@BJM](https://discourse.nodered.org/u/BJM)\
**Post date:** [13 August 2023 11:02 UTC](https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529/8 "2023-08-13T11:02:55Z")

</div>

Thanks to both of you. I understand it now 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 October 2023 11:03 UTC](https://discourse.nodered.org/t/syntax-error-in-documentation-for-using-context/80529/9 "2023-10-12T11:03:16Z")

</div>

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