You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've stumbled upon a similar issue to that reported in dpd-static-support/issues/3, except in this case I'm not using Whitenoise and it occurs when using the built-it Django collectstatic command using ManifestStaticFilesStorage.
When collecting static files with Django>=4.2.0 (and the the Django project makes use of dpd-static-support), Django raises an exception and aborts the collection:
$ python manage.py collectstatic
...
Post-processing 'dash/component/dpd_static_support/static/dpd_static_support/css/bootstrap-grid.min.css' failed!
...
Traceback (most recent call last):
...
ValueError: The file 'dash/component/dpd_static_support/static/dpd_static_support/css/bootstrap-grid.min.css.map' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7fdc0a1d5bb0>.
The reason this fails is because the Django collectstatic command picks up on the comments inside the js and css files which describe the corresponding map files. In this case bootstrap-grid.min.css contains a comment referencing a non-existent map file: /*# sourceMappingURL=bootstrap-grid.min.css.map */.
Arguably, this is really a bug in Django itself https://code.djangoproject.com/ticket/21080, but I don't think it's going to get resolved anytime soon given the age of the ticket. It might be worth some small changes in this repo, which I think would also resolve similar issues seen with Whitenoise.
Potential solutions might include:
the map file comments could be stripped from each of the js and css files, but then of course these do not match the downloaded versions/hashes.
perhaps a better alternative is to also include the map files themselves in the distribution?
For anyone else getting the same issue, you can tell Django not to run post-processing when using collectstatic to skirt around the issue: python manage.py collectstatic --no-post-process
The text was updated successfully, but these errors were encountered:
I've stumbled upon a similar issue to that reported in dpd-static-support/issues/3, except in this case I'm not using Whitenoise and it occurs when using the built-it Django
collectstatic
command usingManifestStaticFilesStorage
.When collecting static files with
Django>=4.2.0
(and the the Django project makes use ofdpd-static-support
), Django raises an exception and aborts the collection:The reason this fails is because the Django collectstatic command picks up on the comments inside the js and css files which describe the corresponding map files. In this case
bootstrap-grid.min.css
contains a comment referencing a non-existent map file:/*# sourceMappingURL=bootstrap-grid.min.css.map */
.Arguably, this is really a bug in Django itself https://code.djangoproject.com/ticket/21080, but I don't think it's going to get resolved anytime soon given the age of the ticket. It might be worth some small changes in this repo, which I think would also resolve similar issues seen with Whitenoise.
Potential solutions might include:
For anyone else getting the same issue, you can tell Django not to run post-processing when using collectstatic to skirt around the issue:
python manage.py collectstatic --no-post-process
The text was updated successfully, but these errors were encountered: