Skip to content

When themes are packaged as plugins they throw errors at startup #5805

Closed

Description

@hardillb

Current Behavior

[NR] 20/05/2026 09:48:27 [info] forge-light TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
[NR] 20/05/2026 09:48:27 [info]     at Object.dirname (node:path:1408:5)
[NR] 20/05/2026 09:48:27 [info]     at loadNodeLocales (/opt/share/projects/flowfuse/test/device/var/project/node_modules/@node-red/registry/lib/loader.js:239:35)
[NR] 20/05/2026 09:48:27 [info]     at loadPluginConfig (/opt/share/projects/flowfuse/test/device/var/project/node_modules/@node-red/registry/lib/loader.js:337:11)
[NR] 20/05/2026 09:48:27 [info]     at loadModuleTypeFiles (/opt/share/projects/flowfuse/test/device/var/project/node_modules/@node-red/registry/lib/loader.js:84:31)
[NR] 20/05/2026 09:48:27 [info]     at loadModuleFiles (/opt/share/projects/flowfuse/test/device/var/project/node_modules/@node-red/registry/lib/loader.js:127:60)
[NR] 20/05/2026 09:48:27 [info]     at load (/opt/share/projects/flowfuse/test/device/var/project/node_modules/@node-red/registry/lib/loader.js:43:12)
[NR] 20/05/2026 09:48:27 [info]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[NR] 20/05/2026 09:48:27 [info]   code: 'ERR_INVALID_ARG_TYPE'
[NR] 20/05/2026 09:48:27 [info] }

See FlowFuse/device-agent#631 for more logs

Problem is on line 239 of @node-red/registry/lib/loader.js

async function loadNodeLocales(node) {
if (node.module === 'node-red') {
// do not look up locales directory for core nodes
node.namespace = node.module;
return node
}
const baseFile = node.file||node.template;
return fs.stat(path.join(path.dirname(baseFile),"locales")).then(stat => {
node.namespace = node.id;
return i18n.registerMessageCatalog(node.id,
path.join(path.dirname(baseFile),"locales"),
path.basename(baseFile).replace(/\.[^.]+$/,".json"))
.then(() => node);
}).catch(err => {
node.namespace = node.module;
return node;
});
}

Looks to be the same in NR 5.0

The node object has no file or template field

(Also should a theme have locales?)

Expected Behavior

No errors on startup

Steps To Reproduce

Start FF device agent instance with 4.1.11

Example flow

paste your flow here

Environment

  • Node-RED version: 4.1.11
  • Node.js version: 20
  • npm version: 10
  • Platform/OS: linux
  • Browser: na

Activity

  1. self-assigned this
    on Jun 14, 2026
  2. knolleary commented on Jun 25, 2026

    @knolleary
    Member

    The real cause of this error was that the plugin files identified in package.json didn't exist in the plugin. That is a special kind of broken and something we should identify and report back. I'll raise a separate issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions