Create an HTML file with this simple code and open it in Safari.
<html>
<head>
<script type="application/ld+json">
[
{
"@context": "http://schema.org",
"@type": "Organization",
"name": "Parqet",
"url": "https://www.parqet.com/",
"logo": "https://www.parqet.com/logos/parqet_logo_pos.svg",
"sameAs": [
"https://www.facebook.com/parqetcom",
"https://twitter.com/ParqetApp",
"https://www.instagram.com/ParqetApp/",
"https://www.youtube.com/channel/UC4LOcElG8Z73Hvgbbp3m1KQ",
"https://www.linkedin.com/company/parqet/",
"https://github.com/tresorone"
]
}
]
</script>
</head>
<body>
test
</body>
</html>
Safari will produce this error.
TypeError: undefined is not an object (evaluating 'r["@context"].toLowerCase')

Any insight into how we could fix that is greatly appreciated. Adding a trailing comma to the last property or object removes the error - but it's not valid JSON anymore.
Looks like Safari has a problem with the Array and wants an Object instead.
To still write multiple JSON-LD definitions, we can use the @graph notation.
This fixes the error.
<html>
<head>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@graph": [
{
"@type": "Organization",
"name": "Parqet",
"url": "https://www.parqet.com/",
"logo": "https://www.parqet.com/logos/parqet_logo_pos.svg"
}
]
}
</script>
</head>
<body>
test
</body>
</html>
To be clear: an Array of Objects is perfectly valid. I suspect this is a bug in Safari.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With