Closed artemklevtsov closed 1 month ago
@Ramon00 any ideas?
What is wrong with that line?
Maybe missing a dependency?
This error happens when a string with syntax errors is passed to the E()
function. Could be an invalid translation string containing broken HTML tags or something like a weird hostname containing special chars.
@Ramon00 is there a way to dump the (hostname etc) info from the command line to see what the GUI would be receiving?
@artemklevtsov I escaped more strings in an update recently. This is available on master branch, could you try that one and see if it is fixed?
How can I install it?
Just download the file manually and put it in the right directory.
@artemklevtsov ubus call luci-rpc getHostHints
would generate the list. Next to that the app also tries a nslookup for the IPs which it finds
@Ramon00 please reference the commit with fix. I don't see any changes in the usteer.js
on master.
@artemklevtsov
ubus call luci-rpc getHostHints
would generate the list. Next to that the app also tries a nslookup for the IPs which it finds
Output:
{"00:D8:61:D7:B6:EA":{"ipaddrs":["192.168.1.3"],"ip6addrs":["fd80:888a:fdf4::6c9","fdda:a71d:c2de::6c9","fe80::87d0:b1d9:69f0:c6c6"],"name":"*****.lan"},"22:4E:7F:5B:28:23":{"ipaddrs":["192.168.1.250"],"ip6addrs":["fe80::204e:7fff:fe5b:2823"]}}
Also that hosthints output looks fine,assuming the **** does not contain any weird characters?
Also that hosthints output looks fine,assuming the **** does not contain any weird characters?
This is valid hostname (ascii, digits, dash).
I tried this:
cd /tmp/
wget https://raw.githubusercontent.com/openwrt/luci/master/applications/luci-app-usteer/htdocs/
luci-static/resources/view/usteer/usteer.js
cp /www/luci-static/resources/view/usteer/usteer.js usteer.js.bak
cp usteer.js /www/luci-static/resources/view/usteer/usteer.js
Then reload page with clear cache. Nothing has changed. May be I doing something wrong.
you may need to clear your browser cache.
Could be it was not the issue. Are you using english?
You could also try to comment out some of the code to see if you can find more specifically which string is the offending one.
Yes, luci in english. I have 3 routers (various models and arch) and problem happens for everyone.
Are you running nginx on all? Try without and see if that works. Otherwise the only thing I can suggest is start removing pieces of code to narrow the issue down, e.g. comment out e.g. collectRemoteHosts(remotehosttableentries,Remotehosts);
https://github.com/openwrt/luci/blob/master/applications/luci-app-usteer/htdocs/luci-static/resources/view/usteer/usteer.js#L225 and
https://github.com/openwrt/luci/blob/master/applications/luci-app-usteer/htdocs/luci-static/resources/view/usteer/usteer.js#L344
Similarly you can comment out collectWlanAPInfoEntries
, collectWlanAPInfos
and collectHearingClient
The same error with uhttpd. nginx started only on the main router.
Does anyone else reproduce this error? Maybe I have something configured wrong?
After commenting out all calls of the mentioned functions error illegal error still present.
Even an incorrect config should not cause this. Just gotta figure out what's happening.
I return the original file. Trace with Chromium differ than Firefox:
192.168.1.1-1723304586716.log console-export-2024-8-10_22-45-10.txt
Line 59, 60 is this:
var body = E([
E('h3', _('Hearing map')),
E('div', _('Refresh page to get new mac addresses to show up'))
]);
Try:
var body = E([
E('h3', 'Hearing map'),
E('div', 'Refresh page to get new mac addresses to show up')
]);
If that now generates an error at a different line number then you have an issue with your translation file/setup.
Any follow-up here?
i cant reproduce, and hence needs trouble shooting by the submitter, or somebody else that can reproduce. tbh it looks like a generic translation file issue, maybe wrong version or something
I have this problem on 3 routers with the english luci only installation. All routers have OpenWRT 23.05.4. usteer 2022-08-18-7d2b17c9-1 luci-app-usteer git-24.233.60980-ae3bc90 I tried Firefox and Chromium with the same results. I also tried files from this thread without success.
it is still going through the translation system I think even if it is english. What happens if you change the line59 60 above? does the line number of the error change?
I found the reason! It's theme. Error occurs with OpenWrt theme. OpenWrt2020 and others is ok.
nice, guess its a matter of finding the difference... Need a theme expert!
little bit debugging on my part (now that i can reproduce the bug). I get the following error with that theme:
SyntaxError
Failed to set the 'innerHTML' property on 'Element': The provided markup is invalid XML, and therefore cannot be inserted into an XML document.
So the default theme uses html and that Openwrt theme uses XHTML+XM, looks like it is related to that. https://stackoverflow.com/questions/27824609/uncaught-syntaxerror-failed-to-set-the-innerhtml-property-on-element-the-p
No sure what part exactly trying to set something invalid though.
@systemcrash Maybe time to retire that old theme, or update it HTML?
ok i have a possible fix in header.ut
replace
http.prepare_content("application/xhtml+xml");
-%}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{ dispatcher.lang }}" lang="{{ dispatcher.lang }}">
with
http.prepare_content('text/html; charset=UTF-8');
-%}
<!DOCTYPE html>
<html lang="{{ dispatcher.lang }}" {{ darkpref ? `data-darkmode="${darkpref}"` : '' }}>
i can make a PR, but not sure if there will be any other fallout of this... Anybody can comment?
Themes are a necessary thorn in the side and I hate xml with a passion. Kill it with fire.
https://github.com/openwrt/luci/pull/7283
have a look please
Possibly fixed by #7283
Steps to reproduce:
Actual behavior:
Expected behavior:
Normal page load.
Additional Information:
OpenWrt version information from system
/etc/openwrt_release
May be important: I use luci with nginx.
/etc/nginx/uci.conf:
Javascript console log: