#34322: ManifestStaticFilesStorage crashes on commented JavaScript import
statements
-------------------------------------+-------------------------------------
     Reporter:  Adam Johnson         |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.staticfiles  |                  Version:  4.2
     Severity:  Normal               |               Resolution:  duplicate
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Adam Johnson):

 I'm not really happy about closing this with just a warning. The previous
 issue covered references inside CSS comments - something that is rare. The
 new issue with JS comments is something we can expect to be very common.
 Currently Django 4.2 will make using two fairly common things - htmx (non-
 minified) and WhiteNoise - crash `collectstatic` with an obscure error
 message.

 We can do better, we have `django.utils.jslex` which can be used to
 identify import statements, rather than relying on fragile regexes. I
 started working on a patch but didn't get far, I don't get much time for
 open source at the moment.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34322#comment:15>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186bdbb84e5-32797fb3-bbec-474a-ae18-07796949e14c-000000%40eu-central-1.amazonses.com.

Reply via email to