FlowFuse / FlowFuse/node-red-dashboard
Cannot load widgets that are part of pre-installed nodes
- Dominant language
- HTML
- Stars
- 355
- Forks
- 82
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 24
Description
### Current Behavior
Currently I package an instance of nodered as a docker image with some nodes that are installed during the build step.
The base image is `nodered/node-red:3.1.11` and the preinstalled nodes are added to `/usr/src/node-red/package.json`. The reason they are added to `/usr/src/node-red/package.json` is because `package.json` in the userDir is overwritten when the image is run as a container and the `RED.settings.userDir` (in this case `/data`) is mounted externally.
- The preinstalled nodes work correctly in the flows.
- Nodes installed through the pallet and installed via the commandline work correctly (as they are added '/data/package.json')
- Thirdparty Widgets of nodes installed at runtime work correctly.
- Thirdparty Widgets of nodes installed at build time show a `'No Vue component found for ', widget.type, ' - falling back to ui-template'` message in the browser console.
I chased the issue down to `ui_base.js` line 90 (working off branch `main` commit id `97de583`) where the third party widgets are loaded. In addition to the `RED.settings.userDir`, it looks like you also have to scan the package.json file in `process.cwd()` for widgets.
### Expected Behavior
Thirdparty widgets of nodes installed in the main `package.json` file should work the same as packages widgets of nodes installed at runtime.
### Steps To Reproduce
1. in the root nodered folder, run `npm install ........` to install a node that contains a third party widget.
2. verify that the node was installed in the `package.json file`
3. run nodered and specify the `--userDir' to another folder.
4. verify that node with the thirdparty plugin is not installed in the `package.json` file in the --userDir folder.
5. create a dashboard with the third party widget.
### Environment
- Dashboard version: 1.14.0
- Node-RED version: 3.1.11
- Node.js version: v18.20.2
- npm version: 10.5.0
- Platform/OS: docker
- Browser: frefox 123.0
### Have you provided an initial effort estimate for this issue?
I can not provide an initial effort estimate
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.