TypeError: Cannot read property 'setup' of undefined (line:289)

Hi everybody,

I have been playing with uibuilder and really enjoying it. Developing it locally, everything has went smoothly but I have been running into an issue when I am deploying it out as a Docker image and I was hoping somebody might point me in the right direction of where to troubleshoot. I have uibuilder, vue, and bootstrap-vue all in a package.json but when I go to the palette I see this error for uibuilder:

Looking at the full logs, here are the messages I am seeing:

> node-red-docker@1.1.2 start /usr/src/node-red
> node index.js "--userDir" "/data"

5 Dec 13:30:04 - [info] 

Welcome to Node-RED
===================

5 Dec 13:30:04 - [info] Node-RED version: v2.1.4
5 Dec 13:30:04 - [info] Node.js  version: v10.24.1
5 Dec 13:30:04 - [info] Linux 5.4.0-1051-azure x64 LE
5 Dec 13:30:04 - [info] Loading palette nodes
5 Dec 13:30:04 - [error] Error: ENOENT: no such file or directory, open '/data/package.json'
Trace: [uibuilder] REQUIRE SOCKET failed:: /usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/libs/socket.js:42
    constructor() {
    ^^^^^^^^^^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uibuilder.js:38:25)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.<anonymous> (/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uibuilder.js:40:13)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at loadNodeSet (/usr/src/node-red/node_modules/@node-red/registry/lib/loader.js:362:17)
    at /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js:460:31
Trace: [uibuilder] REQUIRE WEB failed:: /usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/libs/web.js:47
    constructor() {
    ^^^^^^^^^^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uibuilder.js:43:25)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.<anonymous> (/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uibuilder.js:45:13)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at loadNodeSet (/usr/src/node-red/node_modules/@node-red/registry/lib/loader.js:362:17)
    at /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js:460:31
5 Dec 13:30:06 - [warn] ------------------------------------------------------
5 Dec 13:30:06 - [warn] [node-red-contrib-uibuilder/uibuilder] TypeError: Cannot read property 'setup' of undefined (line:289)
5 Dec 13:30:06 - [warn] ------------------------------------------------------
5 Dec 13:30:06 - [info] Context store  : 'memory' [module=memory]
5 Dec 13:30:06 - [info] Context store  : 'default' [module=localfilesystem]
5 Dec 13:30:06 - [info] +-----------------------------------------------------
5 Dec 13:30:06 - [info] | uibuilder v4.1.4 initialised
5 Dec 13:30:06 - [info] | root folder: /data/uibuilder
5 Dec 13:30:06 - [info] | Using Node-RED's webserver at:
5 Dec 13:30:06 - [info] |   http://undefined:NaN/ or http://localhost:NaN/
5 Dec 13:30:06 - [info] | Installed packages:
5 Dec 13:30:06 - [info] +-----------------------------------------------------
5 Dec 13:30:06 - [info] Starting flows
5 Dec 13:30:06 - [info] Started flows

I am using a mounted volume here as you can see at /data and I do see a uibuilder subfolder get automatically created there. Any hints on what to check would be much appreciated!

Thanks,
Adam

Hi @gingerhelp

You are using node.js 10 which is no longer supported by Node-RED.

You need to upgrade to a more recent node.js version.

1 Like

Ahh - thank you! I completely missed that.

uibuilder and Node-RED minimum versions, as Nick has said, are 12+

Thanks @knolleary and @TotallyInformation - upgrading to the latest node.js fixed me right up. Appreciate both of you!

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