[bug]: vis 1 widgets, no longer work if palette area or attributes area is opend/closed #488
Open
1 task done
Labels
bug 🐞
Something isn't working
No existing issues.
Describe the bug
The widget must have a separate JavaScript file that is included in the widget html.
using. For example the basic table widget.
When the widget has been placed, you can see the demo table. If the palette or attribute area is then closed or opened, the widget no longer works and the following error appears in the browser console. After complete reload with F5 it works again.
17:59:42.811 installHook.js:1 can't render tplTableBody w000005 on "test1":
17:59:42.811 installHook.js:1 0 - TypeError: Cannot read properties of undefined (reading 'showTable')TypeError: Cannot read properties of undefined (reading 'showTable')
17:59:42.811 installHook.js:1 1 - at Object.eval (tplTableBody.js:24:31)
17:59:42.812 installHook.js:1 2 - at n.render (http://localhost:8082/vis-2/lib/js/can.custom.js:2229:46)
17:59:42.813 installHook.js:1 3 - at t.template.fn (http://localhost:8082/vis-2/lib/js/can.custom.js:2223:26)
17:59:42.813 installHook.js:1 4 - at r (http://localhost:8082/vis-2/lib/js/can.custom.js:1370:29)
17:59:42.814 installHook.js:1 5 - at Function.renderTo (http://localhost:8082/vis-2/lib/js/can.custom.js:1449:63)
17:59:42.814 installHook.js:1 6 - at Function.renderAs (http://localhost:8082/vis-2/lib/js/can.custom.js:1465:39)
17:59:42.815 installHook.js:1 7 - at e.view.e.template (http://localhost:8082/vis-2/lib/js/can.custom.js:1401:47)
17:59:42.815 installHook.js:1 8 - at g.renderWidget (http://localhost:8082/vis-2/static/js/470.959dfc40.chunk.js:1:290708)
17:59:42.816 installHook.js:1 9 - at g.componentDidMount (http://localhost:8082/vis-2/static/js/470.959dfc40.chunk.js:1:274414)
17:59:42.816 installHook.js:1 10 - at xi (http://localhost:8082/vis-2/static/js/main.2251327d.js:2:6438219)
Further investigation revealed that these JavaScript files are skipped at the following point and not added to the current document.
However, I have not yet understood the actual meaning of this distinction
ioBroker.vis-2/packages/iobroker.vis-2/src/src/Vis/visEngine.tsx
Line 1673 in 437d432
To Reproduce
Expected behavior
widget is displayed, embedded javascripts are available
Screenshots & Logfiles
no screenshot
Page or affected widget
Adapter version
vis-2 v2.10.7 but same with v2.9.64
js-controller version
5.0.19
Node version
v20.13.1
Operating system
windows/dev-server
Additional context
No response
The text was updated successfully, but these errors were encountered: