DB2: ui-template eCharts fails to load

Hello:

None of my eCharts are rendering - this was working about 1 week ago (we were on vacation) and when I tried today, none of the charts work. Regular NR bar charts, pie charts are working but nothing that uses eCharts.

Console log shows the following error: Failed to load resource: the server responded with a status of 530 (Image below)

However, when I go to "https://fastly.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js" it works.

Node-RED v: 4.1.4
DB2 Version: 1.30.2
Any suggestions?

Thanks for your help.

I Think 530 is a cloudflare specific status code.

And I also think jsdelivr use cloudflare.

You could try an alterative like unpkg https://unpkg.com/echarts@5.4.3/dist/echarts.min.js

1 Like

Also alternatively, you could host the files yourself in a static share or a flow using http in -> load file -> http response

1 Like

Or try https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js which is what I use and is working.

1 Like

Thanks - I changed the CDN and that seemed to fix it. I also realized that I was loading eCharts in every ui-template. I removed those and used the new CDN in a ui-template (Type = widget, Scope = "All Pages"). Hopefully, if there are any changes in the future, I only have to address them in one place :crossed_fingers:t3:

Would the correct way be to put it in a sub-directory in the node-red directory on the RPi that is running Node-RED? I think I also have to make some changes then to the settings.js file - not sure what those are so need to research a bit (if that is the right approach)

What a great idea, I had not thought of doing that. Have now implemented.

1 Like