Javascript does not work ;-)

Hi all,

I am totally new in Node Red and Javascript and I am no SW developer and probably this is already the answer to my question. I have only a little experience in writing and vba software doing this as a hobby but this problem is driving me crazy and I don't want to waste more and more time with this! That's why I ask for help!

The question is:
Why do I have this error shown in the debug area?
I think it comes from the code marked yellow.
But why?
Variable "PVPowerRange_Initial" is used before without any error (marked green)!

Thank you all in advance and sorry for the stupid question!
And please: Don't tell me details about the code in general! I am sure, it can be done much more smarter, but this is not what I am asking for.


is a string not a var, as it has quotes round it. You later refer to it as a var PVPowerRange_Initial with no quotes. As it never existed as a var only a string you get the undefined error.

1 Like

@E1cid: I think you are right. I deleted all " (what's that in english?), but it still does not work...
I will check it and come back.
Until then many thanks!!!

I don't think you were supposed to delete the "quotes" but add "quotes" around the one that was missing them.

If you enable Monaco in your settings file it will help you with JavaScript syntax.

Ps. When pasting code, it is far better to post the actual code (not a screenshot). Be sure to use the </> code button before pasting the code.

1 Like

@E1cid already told me to do so!

Thank you too for your help!

And you think I can manage this without detailed advice?
Unfortunately not.

But I would like to do it ...

A simple search on this forum will reveal the answer :grinning:

Or search Google "node-red enable Monaco" E.g: Updating to node-red version 2.0 | Enable the Monaco Javascript Editor for rich developer experience - YouTube

I'll take the video, thx!

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