sioMiddleware.js not running
See original GitHub issueI’m having issues getting sioMiddleware.js to do anything. I tried changing ~/.node-red/uibuilder/.config/sioMiddleware.js to the code below and am not seeing any error messages logged, either on the uibuilder front end or in node.
// sioMiddleware.js
module.exports = function(socket, next) {
next(new Error('test error from sioMiddleware'));
}
But if I populate sioUse.js with the same code I do get an error as expected.
And the following log shows up in journalctl
Oct 29 13:48:17 raspberrypi Node-RED[26714]: 29 Oct 13:48:17 - [error] [uibuilder:uibuilder] ERROR received, ID: BT65fYSyzTmopURXAAAC, Reason: test error from sioUse
Since this works fine with sioUse.js I’m not sure what I may be doing wrong with sioMiddleware.js. Both files are in ~/.node-red/uibuilder/.config/, and I restarted Node-RED after each change. For my use case, it makes more sense to use sioMiddleware than sioUse since I only want code to run on the initial connection, not every message.
Software and Package Versions
Software | Version |
---|---|
Node.JS | 14.18.1 |
npm | 6.14.15 |
Node-RED | 2.1.3 |
uibuilder node | 4.1.4 |
uibuilderFE | 4.1.1 |
OS | Raspbian GNU/Linux 10 (buster) |
Browser | Firefox 93.0 (64-bit) |
How is Node-RED installed? Where is uibuilder installed?
Node-RED is installed using the provided script at https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered
uibuilder is installed through the Manage Palette to ~/.node-red/node_modules and uibuilder root ~/.node-red/uibuilder
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Fixed in v5/vNext
Yeah, it seems difficult to get a system that works well for everyone, since I’m guessing some people rely completely on uibuilder for security, and then others (like me) really don’t need any of uibuilder’s security features except one or two small pieces.
I hadn’t even noticed this, but I haven’t hooked anything up to the vNext uibuidler node yet, just using it alone for quick UI testing. Good to know it’s no longer an issue though since I’m relying on it for user data!