Missing nodes in Home Assistant addon when loading extra resources

Hello,

I noticed an issue with my node palette @lunatone/node-red-dali in the Node-RED sidebar of the Home Assistant addon where some of the nodes in the palette are missing and cannot be used. When accessing the Node-RED editor directly with the 1880 port no nodes are missing. It seems like it is because the affected nodes rely on the Node-RED feature to load extra resources in HTML files (See: Loading extra resources in the editor : Node-RED). The URL that is requested when using Node-RED from the sidebar in Home Assistant doesn't work and I get this error in the browser.

Has anyone had a similar problem and knows a way around that?

Edit:
This is how I access the resources:

<script type="module">
    import { DALICommands } from "../resources/@lunatone/node-red-dali/dali-frame-html.js";
    ...
</script>

but I also tried it like this:

<script src="resources/@lunatone/node-red-dali/dali-commands.js"></script>

Hi,
And with this?

<script type="text/javascript" src="resources/@lunatone/node-red-dali/dali-commands.js"></script>

Not sure the export works there :thinking:

export{DALICommands}from"./common/dali-commands.js";

Thanks for trying to help!

I noticed that I didn't entirely understand how these relative paths work in HTML. So I replaced the double dots in my import path with a single one and it suddenly worked as expected.

<script type="module">
    import { DALICommands } from "./resources/@lunatone/node-red-dali/common/dali-commands.js";
    ...
</script>

It did work so far but I replaced this file anyways. I'm now importing the dali-commands.js directly.

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