Luci-js is somtimes not loading cbi?

For Freifunk Berlin we have that luci-ffwizard. With the new luci version, we have the issue that sometimes the cbi part is not loading:

Following error:

TypeError: L.ui is undefined
    cbi_init http://192.168.42.1/luci-static/resources/cbi.js?v=git-20.247.75781-0d0ab01:50
    cbi_init http://192.168.42.1/luci-static/resources/cbi.js?v=git-20.247.75781-0d0ab01:50
    initDOM http://192.168.42.1/luci-static/resources/luci.js?v=git-20.247.75781-0d0ab01:199
    setupDOM http://192.168.42.1/luci-static/resources/luci.js?v=git-20.247.75781-0d0ab01:199
    promise callback*__init__ http://192.168.42.1/luci-static/resources/luci.js?v=git-20.247.75781-0d0ab01:150
    ClassConstructor http://192.168.42.1/luci-static/resources/luci.js?v=git-20.247.75781-0d0ab01:11
    <anonymous> http://192.168.42.1/cgi-bin/luci/admin/freifunk/assistent/generalInfo:42
luci.js:160:9

Reloading (approx 5 times) the pages helps and it will be displayed correctly.
Any idea what happens? I saw there are a lot of new luci changes introduced. I think we have to adapt our wizard to this new changes. But in the meantime I would like to have that fixed.

Don't rely on L.ui being available but add 'require ui'; to the top of your view code and use ui.xxx throughout the entire code (basically s/L.ui/ui/g)

1 Like

Thanks for your help! But we do not use L.ui at all? That is why I do not understand the error.

The viewcode is here:

I am using openwrt 19.07 and facing same kind of error when instance of openvpn client is created and enabled.

I cant see L.ui being used anywhere in openvpn code.

If I do
rm -fr /tmp/luci-indexcache
rm -fr /tmp/luci-modulecache
luci-reload

then the issue goes away.