TCP port field error when defined as a variable

In my flow properties I set some environment variables (strings):
device-ip = 10.10.10.10
device-port = 12345

Then I add a TCP request node and set its properties:
Server = ${device-ip}
Port = ${device-port}

(There are reasons for this which I won't get into now)

This works correctly, but the port field generates an error every time that I deploy (The workspace contains some nodes that are not properly configured).

How can I ignore the error seeing as it works as expected?

Node-RED v4.0.9

Can someone who is familiar with the node-red source code point me towards the relevant section where the fields are checked at the deploy stage, so that I can create a pull request to make the "port" field behave the same as the "server" field, thus eliminating this annoying bogus error message.

Before raising a PR, please raise an issue and provide all the necessary info (and demo flow) (and potentially a gif or short video that demonstrates what you are seeing).

Done: issue #5093

1 Like

Thanks.

I replied to your issue:

FWIW, It's generally considered best practice to stick to uppercase letters and underscores.

REF: Environment Variables

In fact, if you defined your env vars in the more traditional way (e.g. TCP_PORT) this does not happen

Image

So you can move forwards today if you wish.

The fact Node-RED correctly evaluates tcp-ip today means the likely fix is to improve the numeric validator.

Thank you @Steve-Mcl - I really appreciate your time and advice.