# Use of unknown context store in function node error doesn't ref node

**URL:** <https://discourse.nodered.org/t/use-of-unknown-context-store-in-function-node-error-doesnt-ref-node/59788>\
**Category:** Core Development\
**Created:** [13 March 2022 10:41 UTC](https://discourse.nodered.org/t/use-of-unknown-context-store-in-function-node-error-doesnt-ref-node/59788 "2022-03-13T10:41:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 March 2022 10:41 UTC](https://discourse.nodered.org/t/use-of-unknown-context-store-in-function-node-error-doesnt-ref-node/59788/1 "2022-03-13T10:41:23Z")

</div>

The use of an unknown context store in a function node generates a warning (should it be an error?) which does not indicate the node where the error exists. For example, in a Function node, the line  
`let x = context.get("x","31")`  
Shows

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

So it can be difficult to determine where the fault lies.  
If it is not difficult to improve this then I suggest that would be worth doing. Should I raise an issue?

---

<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 March 2022 11:38 UTC](https://discourse.nodered.org/t/use-of-unknown-context-store-in-function-node-error-doesnt-ref-node/59788/2 "2022-03-13T11:38:24Z")

</div>

> [@Colin](#):
>
> If it is not difficult to improve this then I suggest that would be worth doing. Should I raise an issue?

It doesn't report the location because it _is_ difficult to know at the point we are able to detect the bad store name, exactly what node called the context API with the bad store name.

Please do raise an issue - but there isn't a quick fix here.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 March 2022 11:40 UTC](https://discourse.nodered.org/t/use-of-unknown-context-store-in-function-node-error-doesnt-ref-node/59788/3 "2022-03-13T11:40:41Z")

</div>

I guessed that might be the case, though it might have been an oversight.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 March 2022 11:53 UTC](https://discourse.nodered.org/t/use-of-unknown-context-store-in-function-node-error-doesnt-ref-node/59788/4 "2022-03-13T11:53:41Z")

</div>

Issue raised: [Use of unknown context store in function node, error doesn't ref node · Issue #3490 · node-red/node-red · GitHub](https://github.com/node-red/node-red/issues/3490)

---

<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 May 2022 11:54 UTC](https://discourse.nodered.org/t/use-of-unknown-context-store-in-function-node-error-doesnt-ref-node/59788/5 "2022-05-12T11:54:06Z")

</div>

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