# Dashboard 2.0 Object.hasOwn is not a function

**URL:** https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [16 February 2024 19:55 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603 "2024-02-16T19:55:34Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![nodouser](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nodouser](https://discourse.nodered.org/u/nodouser)
#### Post date: [16 February 2024 19:55 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/1 "2024-02-16T19:55:34Z")

</div>

Hi,

I just started with dashboard 2.0 , it works, but there is an error.  
What is the reason of this error? I'm trying to understand what causes this

 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/6/b61ba1d141da81f72e6ba42e34aa03b26f616884.png)

---

<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: [16 February 2024 20:54 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/2 "2024-02-16T20:54:32Z")

</div>

That is odd indeed.

Can you export that flow for others to test please?

---

<div class="post-metadata">

### Author: ![nodouser](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nodouser](https://discourse.nodered.org/u/nodouser)
#### Post date: [16 February 2024 21:17 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/3 "2024-02-16T21:17:35Z")

</div>

Thank for your support,

```auto
[
    {
        "id": "25409e71b4d675dc",
        "type": "tab",
        "label": "Error dashboard 2.0",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "14052efb8fd17bcf",
        "type": "ui-gauge",
        "z": "25409e71b4d675dc",
        "name": "test",
        "group": "735425a9791cc343",
        "order": 4,
        "width": "5",
        "height": "3",
        "gtype": "gauge-half",
        "gstyle": "needle",
        "title": "test",
        "units": "",
        "prefix": "",
        "suffix": "",
        "segments": [
            {
                "from": "0",
                "color": "#5cd65c"
            },
            {
                "from": "15",
                "color": "#ffc800"
            },
            {
                "from": "30",
                "color": "#ea5353"
            }
        ],
        "min": 0,
        "max": "100",
        "sizeThickness": 16,
        "sizeGap": 4,
        "sizeKeyThickness": 8,
        "styleRounded": true,
        "styleGlow": false,
        "className": "",
        "x": 770,
        "y": 140,
        "wires": []
    },
    {
        "id": "a3f620b998040cde",
        "type": "inject",
        "z": "25409e71b4d675dc",
        "name": "10",
        "props": [
            {
                "p": "payload.nvalue",
                "v": "10",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 410,
        "y": 120,
        "wires": [
            [
                "87245d7263a0bc79",
                "cb466e5045acfc46"
            ]
        ]
    },
    {
        "id": "87245d7263a0bc79",
        "type": "debug",
        "z": "25409e71b4d675dc",
        "name": "debug 46",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 600,
        "y": 200,
        "wires": []
    },
    {
        "id": "69956835c0969cdc",
        "type": "inject",
        "z": "25409e71b4d675dc",
        "name": "20",
        "props": [
            {
                "p": "payload.nvalue",
                "v": "20",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 410,
        "y": 180,
        "wires": [
            [
                "87245d7263a0bc79",
                "cb466e5045acfc46"
            ]
        ]
    },
    {
        "id": "cb466e5045acfc46",
        "type": "function",
        "z": "25409e71b4d675dc",
        "name": "function 3",
        "func": "// Set msg.payload to msg.payload.nvalue\nmsg.payload = msg.payload.nvalue;\n\n// Return the modified message\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 600,
        "y": 160,
        "wires": [
            [
                "14052efb8fd17bcf",
                "25ec1d5eecc5a922"
            ]
        ]
    },
    {
        "id": "25ec1d5eecc5a922",
        "type": "debug",
        "z": "25409e71b4d675dc",
        "name": "debug 47",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 780,
        "y": 180,
        "wires": []
    },
    {
        "id": "1733ed5d12191dff",
        "type": "inject",
        "z": "25409e71b4d675dc",
        "name": "29",
        "props": [
            {
                "p": "payload.nvalue",
                "v": "29",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 410,
        "y": 240,
        "wires": [
            [
                "cb466e5045acfc46",
                "87245d7263a0bc79"
            ]
        ]
    },
    {
        "id": "735425a9791cc343",
        "type": "ui-group",
        "name": "Testdash",
        "page": "2c8dbd8f4d392b7b",
        "width": "26",
        "height": "14",
        "order": -1,
        "showTitle": true,
        "className": "",
        "visible": "true",
        "disabled": "false"
    },
    {
        "id": "2c8dbd8f4d392b7b",
        "type": "ui-page",
        "name": "Test page",
        "ui": "07d9e68410f8668f",
        "path": "/page1",
        "icon": "home",
        "layout": "grid",
        "theme": "73c61bc8a0120c97",
        "order": -1,
        "className": "",
        "visible": true,
        "disabled": false
    },
    {
        "id": "07d9e68410f8668f",
        "type": "ui-base",
        "name": "UI Name",
        "path": "/dashboard",
        "includeClientData": true,
        "acceptsClientConfig": [
            "ui-notification",
            "ui-control"
        ],
        "showPathInSidebar": false
    },
    {
        "id": "73c61bc8a0120c97",
        "type": "ui-theme",
        "name": "Theme Name",
        "colors": {
            "surface": "#ffffff",
            "primary": "#0094ce",
            "bgPage": "#eeeeee",
            "groupBg": "#ffffff",
            "groupOutline": "#cccccc"
        },
        "sizes": {
            "pagePadding": "12px",
            "groupGap": "12px",
            "groupBorderRadius": "4px",
            "widgetGap": "12px"
        }
    }
]

```

---

<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: [16 February 2024 21:58 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/4 "2024-02-16T21:58:31Z")

</div>

What version of nodejs are you using? Use node -v to find out. If it is 14.x then it may be another instance of this issue. ["TypeError: Object.hasOwn is not a function" Error · Issue #316 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/316)

If so then possibly the change there needs to be made in the gauge node too.

---

<div class="post-metadata">

### Author: ![nodouser](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nodouser](https://discourse.nodered.org/u/nodouser)
#### Post date: [16 February 2024 22:02 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/5 "2024-02-16T22:02:07Z")

</div>

I am using, v14.21.3

---

<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: [16 February 2024 22:06 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/6 "2024-02-16T22:06:10Z")

</div>

Ah, that's your problem. [Object.hasOwn](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn) requires node v16+

Ps, node v14 is out of support as is v16. You should aim for v18lts or v20 lts

---

<div class="post-metadata">

### Author: ![nodouser](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nodouser](https://discourse.nodered.org/u/nodouser)
#### Post date: [16 February 2024 22:08 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/7 "2024-02-16T22:08:22Z")

</div>

Okay, then i need to update. Is there a wiki for an easy update?

---

<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: [16 February 2024 22:11 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/8 "2024-02-16T22:11:17Z")

</div>

There are too many variables (like what OS, what hardware etc). Tell us what you have first.

---

<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: [16 February 2024 22:12 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/9 "2024-02-16T22:12:45Z")

</div>

I believe it should be fixed in the gauge node as dashboard 2 is supposed to work with v14.

---

<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: [16 February 2024 22:15 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/11 "2024-02-16T22:15:35Z")

</div>

> [@Colin](#):
>
> supposed to work with v14.

I don't remember reading that.

Either way, upgrading node would fix this for the Op and it is definitely recommended as v14 is EOL 🤷‍♂️

---

<div class="post-metadata">

### Author: ![nodouser](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nodouser](https://discourse.nodered.org/u/nodouser)
#### Post date: [16 February 2024 22:19 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/12 "2024-02-16T22:19:45Z")

</div>

I have NUC, proxmox, with Debian 11 bullseye.

---

<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: [16 February 2024 23:27 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/13 "2024-02-16T23:27:50Z")

</div>

> [@nodouser](#):
>
> Debian

Then your upgrade is simple, from the [docs](https://nodered.org/docs/getting-started/raspberrypi)

```auto
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node18

```

---

<div class="post-metadata">

### Author: ![nodouser](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nodouser](https://discourse.nodered.org/u/nodouser)
#### Post date: [18 February 2024 11:57 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/14 "2024-02-18T11:57:02Z")

</div>

Thanks for your support it worked.

Keep up the good work!

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [18 February 2024 15:06 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/15 "2024-02-18T15:06:45Z")

</div>

> [@Steve-Mcl](#):
>
> Ah, that's your problem. [Object.hasOwn](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn) requires node v16+

Does that mean that D2 requires Node.js \>14 which is still Node-RED's baseline?

---

<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: [18 February 2024 15:23 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/16 "2024-02-18T15:23:17Z")

</div>

> [@TotallyInformation](#):
>
> Does that mean that D2 requires Node.js \>14 which is still Node-RED's baseline?

Not for long 😉

In seriousness tho, I playing in the dashboard source & spotted `Object.hasOwn` is used in the dashboard frontend vue files but they get converted to ES5 through compilation (vite config), the nodes are not & have therefore slipped through the net.

If an issue is raised on dashboard, they will get mopped up. For quick reference, `Object.hasOwn` appears twice in `ui_base.js`

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [18 February 2024 15:25 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/17 "2024-02-18T15:25:06Z")

</div>

> [@Steve-Mcl](#):
>
> Not for long

Not wanting to push - but any idea of timescales for v4? I've a bunch of outstanding changes for UIBIULDER that I class as potentially breaking but I don't want to add them until the node.js baseline version also changes.

---

<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: [18 February 2024 15:27 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/18 "2024-02-18T15:27:30Z")

</div>

Nick was out last week but AFAIK it pretty much next on the TODO list. (Nick, jump in correct me if I am speaking out of turn)

If I were a betting man, I'd put money on \< 1 month for a v4 beta.

---

<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: [18 February 2024 15:30 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/19 "2024-02-18T15:30:47Z")

</div>

> [@Steve-Mcl](#):
>
> If an issue is raised on dashboard, they will get mopped up.

There already is an issue. [TypeError: Object.hasOwn is not a function" Error · Issue #316 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/316)

---

<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: [18 February 2024 15:37 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/20 "2024-02-18T15:37:05Z")

</div>

thanks colin.

I've raised a PR: [Remove `Object.hasOwn` from node source by Steve-Mcl · Pull Request #590 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/pull/590)

---

<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: [19 March 2024 15:37 UTC](https://discourse.nodered.org/t/dashboard-2-0-object-hasown-is-not-a-function/85603/21 "2024-03-19T15:37:15Z")

</div>

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