[Django] #34322: ManifestStaticFilesStorage crashes

4 views
Skip to first unread message

Django

unread,
Feb 8, 2023, 12:25:25 PM2/8/23
to django-...@googlegroups.com
#34322: ManifestStaticFilesStorage crashes
-----------------------------------------------+------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Bug | Status: new
Component: contrib.staticfiles | Version: 4.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------------+------------------------
#32319 added module support to `ManifestStaticFilesStorage`. It can crash
with imports in comments, which bundlers like Webpack can leave in.

Example:

{{{
//** @type {import("./htmx").HtmxApi} */
}}}

Leads to:

{{{
whitenoise.storage.MissingFileError: The file 'example/dist/htmx' could
not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage
object at 0x16ff630a0>.

The JS file 'example/dist/app.js' references a file which could not be
found:
example/dist/htmx

Please check the URL references in this JS file, particularly any
relative paths which might be pointing to the wrong location.
}}}

The regex should be adjusted to only select imports that are alone on a
line, with whitespace.

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

Django

unread,
Feb 8, 2023, 12:44:01 PM2/8/23
to django-...@googlegroups.com
#34322: ManifestStaticFilesStorage crashes
-------------------------------------+------------------------------------

Reporter: Adam Johnson | Owner: nobody
Type: Bug | Status: new
Component: contrib.staticfiles | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by Carlton Gibson):

* severity: Normal => Release blocker
* stage: Unreviewed => Accepted


Comment:

Grrr. OK. Sigh. Thanks for the report Adam. (I didn't run it, but I'm
going to trust you)

(Mariusz was right to be sceptical that this was going to be OK. . :)

Let's look at a fix here but:

> I think we need to be prepared to say where we're not going to try more
complex solutions.
> (https://code.djangoproject.com/ticket/32319#comment:21)

--
Ticket URL: <https://code.djangoproject.com/ticket/34322#comment:1>

Reply all
Reply to author
Forward
0 new messages