#61229 closed defect (bug) (invalid)
Twenty Seventeen: "undefined is not an object" in JS detection
| Reported by: | domainsupport | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Bundled Theme | Version: | 6.5.3 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | javascript |
Description
Hello,
We have noticed that when using Twenty Seventeen in Safari the following error is displayed in the console ...
TypeError: undefined is not an object (evaluating 'r["@context"].toLowerCase')
... relating to the JavaScript detection in the header ...
<script>
(function(html) {
html.className = html.className.replace(/\bno-js\b/, 'js')
})(document.documentElement);
</script>
This is only shown when you are signed in.
You can actually see this on the Twenty Seventeen theme page here (when signed in to wordpress.org) ... https://en-gb.wordpress.org/themes/twentyseventeen/
Just sign in, visit that page with Safari and inspect the console for errors!
Oliver
Change History (4)
#2
@
2 years ago
- Focuses javascript added
- Keywords needs-testing added
Thanks for the report!
This will need testing in Safari for multiple themes.
Three default themes use the same script to replace the class on html:
Twenty Twenty similarly replaces the no-js class, but not in the same way.
Twenty Twenty-One just removes no-js from the (body) class list.
#3
@
2 years ago
- Resolution → invalid
- Status new → closed
Apologies. It looks like this is a bug in Safari that is referencing the theme inline script as the source erroneously in the console.
The true cause would appear to be arrays within schema json.
Oliver
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Actually, looks like the error appears whether you're signed in or not but it seems to be shown only in Safari (not in Chrome, Firefox or Opera).
Oliver