ioBroker / ioBroker.vis

Visualisation for ioBroker platform.
MIT License
304 stars 69 forks source link

Uncaught TypeError: views[view].widgets[group] is undefined #699

Open bkomac opened 1 year ago

bkomac commented 1 year ago

Describe the bug
After some small change (maybe just the position of some random widget) causes Vis project to become unstable and won't load anymore. Have to switch to default project and re-import the original project from backup. The error in browser console is the same on vis view and admin page: Uncaught TypeError: views[view].widgets[group] is undefined

To Reproduce
I can provide vis-views.json. vis-views.json.txt

Expected behavior
Vis project to load ok.

Screenshots & Logfiles
Posnetek zaslona 2023-04-10 175945 console-export-2023-4-10_18-1-11.txt console-export-2023-4-10_18-0-51.txt

Versions:

Additional context
package-lock.json.txt

maffi-git commented 8 months ago

I have this problem too. Created some new groups in vis and after that, it broke. Now I have to find out, how to restore that backup...

p-kehling commented 5 months ago

+1 I have same issue. I cannot restore my view from backup.

Current workaround i found, edit the file files/vis/js/visUtils.js line 513 and 514 to:

var result3 = replaceGroupAttr(lcsid, views[view].widgets[ggroup].data);
if (result3.doesMatch) {

to:

var result3 = replaceGroupAttr(lcsid, views[view].widgets[ggroup]?.data);
if (result3?.doesMatch) {

(adding ? on property accessor)

Now vis is loading again, but I miss two widget groups which are now shown white / empty.

I think it's an issue while export, I can reproduce it now with another view.

Can someone please help?