# Function node displays \`The workspace contains some nodes that are not properly configured:\`

**URL:** https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810
**Category:** General
**Created:** [23 August 2025 19:01 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810 "2025-08-23T19:01:52Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [23 August 2025 19:01 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810/1 "2025-08-23T19:01:52Z")

</div>

I'm using some javascript in a function node, but when I deploy it, I get a red triangle on the node, and a pop-up saying `The workspace contains some nodes that are not properly configured:` and `options` is highlighted from this line;  
`const parts = new Intl.DateTimeFormat('en-GB', options).formatToParts(now);`  
The javascript runs ok, and does what it's supposed to do, but it's a pain having to acknowledge the popup every time I deploy.  
Is there a problem with the code?

```auto
// Get or initialize chart data
let chartData1 = flow.get("chartData1") || {
    x: [],
    y: []
};

// Handle flush request
if (msg.topic === "flush") {
    msg.payload = [{
        x: chartData1.x,
        y: chartData1.y,
        type: "line"
    }];
    return msg;
}

// Validate input
if (!msg.payload || typeof msg.payload.grid !== "number") {
    return null; // drop if invalid
}

// Normal update: append new point
const now = new Date();
const options = {
    timeZone: 'Europe/London',
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit',
    hourCycle: 'h23' // use 24-hour format
};
const parts = new Intl.DateTimeFormat('en-GB', options).formatToParts(now);
const obj = Object.fromEntries(parts.map(p => [p.type, p.value]));
const time = `${obj.year}-${obj.month}-${obj.day} ${obj.hour}:${obj.minute}:${obj.second}`;

const value = msg.payload.grid;

chartData1.x.push(time);
chartData1.y.push(value);

// Limit size to 30 minutes
if (chartData1.x.length > 360) {
    chartData1.x.shift();
    chartData1.y.shift();
}
node.status("No of data points = " + chartData1.x.length);

// Save updated context
flow.set("chartData1", chartData1);

// Return just the latest point
msg.payload = [{
    x: [time],
    y: [value],
    type: "line"
}];

return msg;

```

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [23 August 2025 19:16 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810/2 "2025-08-23T19:16:07Z")

</div>

Code looks fine and if I place in a function node I get no Red triangle.

Is there something in the set up tab?  
Have you tried deleting the node and adding a new function node?

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [23 August 2025 19:18 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810/3 "2025-08-23T19:18:06Z")

</div>

> [@E1cid](#):
>
> Is there something in the set up tab?

No

> [@E1cid](#):
>
> Have you tried deleting the node and adding a new function node?

Yes, same result.

I’ve also tried changing the name of the constant ‘options’, and also moving the declaration to the top of the code.

Node-RED version: v4.1.0  
Node.js version: v20.19.4  
Linux 6.8.0-1030-oracle arm64 LE (Ubuntu)  
Oracle cloud server

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [23 August 2025 19:33 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810/4 "2025-08-23T19:33:02Z")

</div>

I am wondering if the .formatToParts(now) is the issue. Have you tried now() or Date.now()

---

<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: [23 August 2025 19:48 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810/5 "2025-08-23T19:48:26Z")

</div>

I am seeing the same thing. If you put the options inline in the call it is ok.

```auto
const parts = new Intl.DateTimeFormat('en-GB', {
    timeZone: 'Europe/London',
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit',
    hourCycle: 'h23' // use 24-hour format
}).formatToParts(now);

```

I think it must be a bug in the syntax checker code. Hovering over `options` (in the original) which has a red line under it says that there is no matching overload, but the popup is not large enough to see exactly what it is complaining about, and I can't work out how to see all of the message.

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

---

<div class="post-metadata">

### Author: ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)
#### Post date: [23 August 2025 22:06 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810/6 "2025-08-23T22:06:46Z")

</div>

I had that, you can also get rid of the error by having `/** @type {Intl.DateTimeFormatOptions} */` just before the `const options = {` line

---

<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: [23 August 2025 23:05 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810/7 "2025-08-23T23:05:19Z")

</div>

This is why: [Monaco clarification - #32 by Steve-Mcl](https://discourse.nodered.org/t/monaco-clarification/47004/32)

---

<div class="post-metadata">

### Author: ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)
#### Post date: [23 August 2025 23:39 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810/8 "2025-08-23T23:39:42Z")

</div>

I'd forgotten that whole conversation, on exactly the same problem 😁

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [24 August 2025 08:31 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810/9 "2025-08-24T08:31:36Z")

</div>

Adding `/** @type {Intl.DateTimeFormatOptions} */` certainly clears the problems, but the strange thing is that I started using that code over 4 weeks ago with no issues whatsoever, and it only started showing yesterday after I re-opened the function node just to look at something. I made no changes, but when I clicked ‘Done’ to exit the node, the issue started.  
(I’ll be glad when the ‘click outside the box’ issue is rolled back 😉 )

But all good now, thanks for all of the responses.

---

<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: [7 September 2025 08:32 UTC](https://discourse.nodered.org/t/function-node-displays-the-workspace-contains-some-nodes-that-are-not-properly-configured/98810/10 "2025-09-07T08:32:16Z")

</div>

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