Node-red crashes and quits when using ui-media


I have installed the node ui-media (1.2.0) to upload a picture to my dashboard. I follow the instructions of the node but when I try to upload the image my Node-Red crash and appear the following message: Lost connection to server. Here is my node-red and node.js versions:
Node-RED = v3.0.2
Node.js = v16.17.0

Can you help me in solving that?

Thank you

  1. what device are you running NR on?
  2. what os?
  3. stop NR and then start it again and copy the output from teh defining to the error and paste t to a reply,

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

   code goes here 

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json

  1. I am running on PC
  2. OS is WIN10
  3. NR crashes and stops immediately after invoking Deploy. There are no error messages can be captured.


Start node red in a command window and leave that window open. Then make it crash and copy/paste the full output from the terminal. Not screen shot please.

When it crashes, the terminal ends immediately.
Please find the screen video capture:

I think you aren't starting it correct way to keep the command prompt open after crash.

You should start the command prompt.
Then type in the command node-red to start it.
Your video starts at the point where Node-RED already is running, so we cant be sure...

Thank you for your advice. Now I can get the failure messges:

11 May 18:40:35 - [red] Uncaught Exception:
11 May 18:40:35 - [error] TypeError: path must be absolute or specify root to res.sendFile
    at ServerResponse.sendFile (C:\Users\yk000chan\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\response.js:441:11)
    at C:\Users\yk000chan\.node-red\node_modules\node-red-contrib-ui-media\ui_media.js:288:17
    at FSReqCallback.oncomplete (node:fs:196:23)

See crashes node red on file selection · Issue #26 · st-one-io/node-red-contrib-ui-media · GitHub

[Edit] It seems that node is no longer supported, so you may need to look for an alternative solution.

Hi Colin,

It works perfectly after the modification suggested in GitHub!
Many thanks!!

I try to use ui-media in raspberry pi and also cannot display the image.
My NR is v3.0.2
Node.js is v16.20.0
The system does not crash but only the image cannot be display and no preview can be got in the node-red console.
Do I need to modify anything inside ui-media.js?


Did you follow the instructions for setting it up (GitHub - st-one-io/node-red-contrib-ui-media: A Node-RED UI node to show media files (image and video) on the dashboard.)?
I haven't used it so can't really help much. Normally one would ask the author of the node for help, but he/she seems to have abandoned the node.

I think there are other ways of showing an image. Search the forum to find relevant posts.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.