<div style="display: flex; flex-wrap: wrap; white-space: pre-wrap; align-items: center; "><img height="20" width="20" style="border-radius:50%; margin-right: 4px;" decoding="async" src="https://avatars.githubusercontent.com/u/248188?s=20&v=4" /><strong>Firefishy</strong> left a comment <a href="https://github.com/openstreetmap/openstreetmap-website/issues/6219#issuecomment-3104839819">(openstreetmap/openstreetmap-website#6219)</a></div>
<p dir="auto">Likely related to the exception being thrown when opening the Map Layers panel:</p>
<pre class="notranslate"><code class="notranslate">application-996133772a2ed2520ff9c51f898158e3039aaebd4c5398cf52d6d905bc7744b2.js:32096 Uncaught TypeError: Cannot read properties of undefined (reading 'find')
    at NewClass.onAdd (application-996133772a2ed2520ff9c51f898158e3039aaebd4c5398cf52d6d905bc7744b2.js:32096:50)
    at NewClass._layerAdd (application-996133772a2ed2520ff9c51f898158e3039aaebd4c5398cf52d6d905bc7744b2.js:23670:10)
    at NewClass.fire (application-996133772a2ed2520ff9c51f898158e3039aaebd4c5398cf52d6d905bc7744b2.js:17379:11)
    at NewClass._resetView (application-996133772a2ed2520ff9c51f898158e3039aaebd4c5398cf52d6d905bc7744b2.js:21084:11)
    at NewClass.setView (application-996133772a2ed2520ff9c51f898158e3039aaebd4c5398cf52d6d905bc7744b2.js:20092:10)
    at setView (index-0f15772a813d980151039882284d8f66967c8c119f39a76b316bcfdca91b7652.js:1489:19)
    at HTMLDivElement.shown (index-0f15772a813d980151039882284d8f66967c8c119f39a76b316bcfdca91b7652.js:1476:11)
    at HTMLDivElement.dispatch (application-996133772a2ed2520ff9c51f898158e3039aaebd4c5398cf52d6d905bc7744b2.js:5135:27)
    at HTMLDivElement.<anonymous> (application-996133772a2ed2520ff9c51f898158e3039aaebd4c5398cf52d6d905bc7744b2.js:4939:28)
    at Object.trigger (application-996133772a2ed2520ff9c51f898158e3039aaebd4c5398cf52d6d905bc7744b2.js:8619:12)
</code></pre>
<p dir="auto">The issue is: <code class="notranslate">const matchedLanguage = supportedLanguages.find(</code></p>
<pre class="notranslate"><code class="notranslate"> onAdd: function (map) {
    L.MaplibreGL.prototype.onAdd.call(this, map);
    const maplibreMap = this.getMaplibreMap();
    const supportedLanguages = maplibregl.Map.prototype.supportedLanguages;
    for (const preferredLanguage of OSM.preferred_languages) {
      const normalizedPreferredLanguage = preferredLanguage
        .toLowerCase()
        .replace("-", "_");
      const matchedLanguage = supportedLanguages.find(
        (supported) => supported.toLowerCase() === normalizedPreferredLanguage
      );
      if (matchedLanguage) {
        maplibreMap.setLanguage(matchedLanguage);
        break;
      }
    }
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/6219#issuecomment-3104839819">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMC3DHEJA2GYLHC7Z33J2SA7AVCNFSM6AAAAACCDYPORGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCMBUHAZTSOBRHE">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLK4NJNZ24JV2YYZ6433J2SA7A5CNFSM6AAAAACCDYPORGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTVZCAMIW.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/6219/3104839819</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>

<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/6219#issuecomment-3104839819",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/6219#issuecomment-3104839819",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>