-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
Description
Current Behavior
I have some custom tests written in Deno that start a Node-RED server. On the first startup everything works perfectly and I can install a custom node. But when the tests restart the server for the next suite, I get this error:
RED.init(server, {
userDir: '/tmp/.node-red'
});err: Error: Set has no types
at Object.addModule (file:///var/.deno-cache/npm/registry.npmjs.org/@node-red/registry/4.1.5/lib/registry.js:227:29)
at file:///var/.deno-cache/npm/registry.npmjs.org/@node-red/registry/4.1.5/lib/loader.js:145:30
at async nodeRedServer (file:///var/src/test/_context/node-red-server.ts:36:3)
code: "set_has_no_types",
details: {
file: "/tmp/.node-red/node_modules/@vendor/package/node-v1/node-v1.js",
Expected Behavior
I would expect that I can restart the server and the existing nodes in the /tmp/.node-red continue to work.
When I made the following changes I could get it to work:
// registry.js
function emptyModuleConfigs() {
moduleConfigs = {};
moduleNodes = {};
}// loader.js
function loadModuleFiles(modules) {
registry.emptyModuleConfigs(); // Add this call here to start fresh before loading the modules
// ....
}Would it make sense to submit this as a patch or am I doing something wrong on my side?
Steps To Reproduce
No response
Example flow
Environment
- Node-RED version: v4.1.5
- Node.js version: v24.2.0
- npm version: 11.9.0
- Platform/OS: Deno in Docker container
- Browser: -
Reactions are currently unavailable