### Current Behavior
If I start Node-RED with a missing **config-node** type, t…he editor shows me the `unknown` type for that config-node. Normal so far.
If I import this same config-node with the correct type (which exists), and replace it, the editor seems to have done its job but when I deploy with `Modified Nodes`, I get the following error:
```txt
27 Jan 19:05:02 - [info] En attente d'enregistrement des types manquants :
27 Jan 19:05:02 - [info] - database-config
27 Jan 19:05:02 - [info] Le serveur est disponible à l'adresse http://127.0.0.1:1880/
27 Jan 19:05:55 - [info] Arrêt des noeuds modifiés
27 Jan 19:05:55 - [info] Noeuds modifiés arrêtés
27 Jan 19:05:55 - [info] Flux mis à jour
27 Jan 19:06:08 - [info] Démarrage des noeuds modifiés
27 Jan 19:06:54 - [red] Uncaught Exception:
27 Jan 19:06:54 - [error] TypeError: Cannot read properties of undefined (reading 'update')
at start (/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:377:31)
```
If I look in the runtime, `activeFlows` is an empty object, so:
```js
activeFlows['global'].update(activeFlowConfig,activeFlowConfig);
```
throws the error.
Note: I didn't notice this error with a full deploy but `activeFlows` is empty when `setFlows` is called.
I also notice that if I import directly the wrong config-node (without modifying the file) then replace it with the correct one and deploy, I have no problems.
But if I try with a **node**, the editor does not handle it: the editor shows me the `unknown` type for this node and when I import this node with the right type, I cannot replace it (even if I force it from the console).
### Expected Behavior
Handle the replacement of an unknown node with the correct one.
Whether it's a node or a config-node.
Note: number of users in config-node is not updated after import.
### Steps To Reproduce
For config-node:
- Stop NR
- Modify the flows.json file by changing the type of a config-node
- Start NR
- Import this node with it's original type
- Replace it
- Deploy with Modified Nodes
For node:
- Stop NR
- Modify the flows.json file by changing the type of a node
- Start NR
- Import this node with it's original type
### Example flow
Add this fake `mqtt-broker` config-node to your `flows.json` file:
```json
[
{
"id": "1deb012b34859b46",
"type": "bad-mqtt-broker",
"name": "Config Node Test",
"broker": "localhost",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]
```
Now replace it with the correct one in the editor:
```json
[
{
"id": "1deb012b34859b46",
"type": "mqtt-broker",
"name": "Config Node Test",
"broker": "localhost",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]
```
### Environment
- Node-RED version: v3.1.3
- Node.js version: v20.10.0
- npm version: v10.2.3
- Platform/OS: MacOS
- Browser: Safari