D2 Third party nodes do not appear - blocked due to forbidden MIME („text/html”)

A user has reported an issue against my gauge-classic node, but in fact it appears that he/she sees the same problem with other third party ui nodes. In the browser tools he sees

/resources/@colinl/node-red-dashboard-2-ui-gauge-classic/ui-gauge-classic.umd.js” zostało zablokowane z powodu niedozwolonego typu MIME („text/html”).

"blocked due to forbidden MIME („text/html”)."

Can anyone throw any light on this? Since the problem is not specific to the gauge node I suggest we have the discussion here rather than on the issue on github.

This can be caused by several things but it is generally because the Express server has no-discover mimetypes turned on and then the links in the HTML are not identifying things correctly.

So I think maybe start by checking the HTML that is being delivered?

It must be something to do with this user's setup, as this is the first time the problem has been seen as far as I know.

The only thing I can think of is a NR server restart - how are they running Node-RED?

The problem mentioned by the OP was originally reported by me. Node-red is installed via docker. The problem occurs in both NR 3.11.1 and 4.0.0 . Flowfuse dashboard 2.0 1.11.1 installed normally from the palette. I just noticed that the problem occurs only when the dashboard is behind nginx reverse proxy. When opening directly everything is ok.

This is very useful detail, thanks. I think @hardillb reported some similar issues to this recently as well actually. I'm guessing we have a hardcoded path that isn't proxy-friendly - will investigate.

1 Like

I see that Joe has opened an issue to track this. Third-party nodes not loading when Dashboard hosted on proxy · Issue #1024 · FlowFuse/node-red-dashboard · GitHub

2 Likes

I have most of my node-red sites behind a nginx-reverse-proxy, and the third party widgets are loading fine (ui-iframe; ui-led; ui-gauge-classic).

So it can be related with the addition of docker.

1 Like