bigskysoftware / htmx

</> htmx - high power tools for HTML
https://htmx.org
Other
38.04k stars 1.29k forks source link

Using Compressor causes Script Syntax Error #2463

Closed mdesco-crgl closed 6 months ago

mdesco-crgl commented 6 months ago

Using django-compressor in an HTML template

{% compress js file demo %}
    <script src="{% static 'demo/js/vendor/htmx/htmx.js' %}"></script> <!--version 1.9.2-->
    <script src="{% static 'demo/js/vendor/htmx/ext/preload.js' %}"></script>
    <script src="{% static 'demo/js/vendor/htmx/ext/morphdom-swap.js' %}"></script>
    <script src="{% static 'demo/js/vendor/hyperscript.js' %}"></script> <!--version 2.0.2-->
  {% endcompress %}

will cause Uncaught SyntaxError: Unexpected token < as GoogleTagManager renders HTML in the compressed .js file due to this error

mdesco-crgl commented 6 months ago

Nevermind, the script I used to download the files from unpkg downloaded the pages from unpkg, not the raw files themselves