return empty string for unnamed routes
{% block extra_js %}
<script>
- const ROUTE_NAME = "{{ request.resolver_match.url_name }}";
+ const ROUTE_NAME = "{{ request.resolver_match.url_name|default_if_none:'' }}";
</script>
{% endblock %}
