ioBroker.vis icon indicating copy to clipboard operation
ioBroker.vis copied to clipboard

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

Open bkomac opened this issue 2 years ago • 2 comments

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:

  • Adapter version: Vis v1.4.16
  • JS-Controller version: 4.0.24
  • Node version: v16.19.0
  • Operating system: Raspbian GNU/Linux 10 (buster)

Additional context
package-lock.json.txt

bkomac avatar Apr 10 '23 16:04 bkomac

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...

maffi-git avatar Feb 11 '24 12:02 maffi-git

+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?

p-kehling avatar May 19 '24 22:05 p-kehling