# TCP In node does not like environment variables

**URL:** <https://discourse.nodered.org/t/tcp-in-node-does-not-like-environment-variables/86147>\
**Category:** Feature Requests\
**Created:** [5 March 2024 09:49 UTC](https://discourse.nodered.org/t/tcp-in-node-does-not-like-environment-variables/86147 "2024-03-05T09:49:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maximus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maximus/32/66678_2.png) [@maximus](https://discourse.nodered.org/u/maximus)\
**Post date:** [5 March 2024 09:49 UTC](https://discourse.nodered.org/t/tcp-in-node-does-not-like-environment-variables/86147/1 "2024-03-05T09:49:02Z")

</div>

When writing a variable name on the TCP In node port, it works as expected but the node shows the little red triangle and a warning is displayed when deploying the flow.  
Is this expected behaviour or can I open an issue in Github?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/b/6b618038fb6f75734e425afc8a2ffd8d35fd2d7a.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd74e473f709a0e694a5997661d9eb273c0cb84c.png)

For information, the TCP Out node behaves graciously when adding an environment variable.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [5 March 2024 09:51 UTC](https://discourse.nodered.org/t/tcp-in-node-does-not-like-environment-variables/86147/2 "2024-03-05T09:51:34Z")

</div>

> [@maximus](#):
>
> Is this expected behaviour or can I open an issue in Github?

Please open an issue.

---

<div class="post-metadata">

**Author:** ![maximus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maximus/32/66678_2.png) [@maximus](https://discourse.nodered.org/u/maximus)\
**Post date:** [5 March 2024 10:17 UTC](https://discourse.nodered.org/t/tcp-in-node-does-not-like-environment-variables/86147/3 "2024-03-05T10:17:50Z")

</div>

> [@maximus](#):
>
> When writing a variable name on the TCP In node port, it works as expected but the node shows the little red triangle and a warning is displayed when deploying the flow.

Done,

> <https://github.com/node-red/node-red/issues/4591>
>
> \### Current Behavior
> 
> When writing a variable name on the TCP In node port, it w…orks as expected but the node shows the little red triangle and a warning is displayed when deploying the flow.
> !\[image\](https://github.com/node-red/node-red/assets/4713166/ed2cea3b-3780-4d4b-a70f-bf004b1323a9)
> !\[image\](https://github.com/node-red/node-red/assets/4713166/3e1e1522-6e2e-42d0-b5bf-cdd53d85b8e3)
> 
> 
> \### Expected Behavior
> 
> No warnings or errors when using environment variable as port value.
> 
> \### Steps To Reproduce
> 
> 1. Bring in the flow a TCP In node.
> 2. Configure it as "Listen on".
> 3. Type an environment variable name in the port field.
> 
> \### Example flow
> 
> \_No response\_
> 
> \### Environment
> 
> \- Node-RED version: v3.1.0
> \- Node.js version: v20.8.0
> \- npm version: v10.1.0
> \- Platform/OS: Windows
> \- Browser: Chrome

Thank you

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [5 March 2024 20:18 UTC](https://discourse.nodered.org/t/tcp-in-node-does-not-like-environment-variables/86147/4 "2024-03-05T20:18:00Z")

</div>

Issue fixed and confirmed working in version 3.1.6

---

<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:** [4 May 2024 20:18 UTC](https://discourse.nodered.org/t/tcp-in-node-does-not-like-environment-variables/86147/5 "2024-05-04T20:18:40Z")

</div>

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