#33253: Collectstatic fails when using ManifestStaticFilesStorage and specific
Javascript file
-------------------------------------+-------------------------------------
               Reporter:  Hervé Le   |          Owner:  nobody
  Roy                                |
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  4.0
  contrib.staticfiles                |       Keywords:
               Severity:  Normal     |  ManifestStaticFilesStorage
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 {{{
 python manage.py collectstatic --no-input
 Post-processing 'rest_framework/docs/js/highlight.pack.js' failed!
 }}}

 '''Steps to reproduce the issue'''

 Start a new project
 {{{django-admin startproject mysite}}}

 Install the following packages
 {{{
 Django==4.0b1
 djangorestframework~=3.12
 }}}

 Add {{{rest_framework}}} to installed apps

 Update {{{settings.py}}} to use ManifestStaticFilesStorage
 {{{
 STATIC_ROOT = BASE_DIR / 'static'
 STATICFILES_STORAGE =
 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
 }}}

 Run collecstatic
 {{{
 python manage.py collectstatic --no-input
 Post-processing 'rest_framework/docs/js/highlight.pack.js' failed!

 Traceback (most recent call last):
   File "/home/Devs/Sandbox/django4/mysite/manage.py", line 22, in <module>
     main()
   File "/home/Devs/Sandbox/django4/mysite/manage.py", line 18, in main
     execute_from_command_line(sys.argv)
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/core/management/__init__.py", line 425, in
 execute_from_command_line
     utility.execute()
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/core/management/__init__.py", line 419, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/core/management/base.py", line 373, in run_from_argv
     self.execute(*args, **cmd_options)
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/core/management/base.py", line 417, in execute
     output = self.handle(*args, **options)
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/contrib/staticfiles/management/commands/collectstatic.py",
 line 187, in handle
     collected = self.collect()
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/contrib/staticfiles/management/commands/collectstatic.py",
 line 134, in collect
     raise processed
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/contrib/staticfiles/storage.py", line 321, in
 _post_process
     content = pattern.sub(converter, content)
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/contrib/staticfiles/storage.py", line 207, in converter
     hashed_url = self._url(
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/contrib/staticfiles/storage.py", line 144, in _url
     hashed_name = hashed_name_func(*args)
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/contrib/staticfiles/storage.py", line 371, in _stored_name
     cache_name = self.clean_name(self.hashed_name(name))
   File "/home/Devs/Sandbox/django4/venv/lib/python3.9/site-
 packages/django/contrib/staticfiles/storage.py", line 106, in hashed_name
     raise ValueError("The file '%s' could not be found with %r." %
 (filename, self))
 ValueError: The file 'rest_framework/docs/js/,constant:' could not be
 found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage
 object at 0x7f3aa1b7ebe0>.
 }}}

 It used to work with previous versions of ManifestStaticFilesStorage.
 Maybe a regression with the recent additions of ES Module support and
 Javascript source map support ?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33253>
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/049.e16667aace2683a1798c284dd22439b5%40djangoproject.com.

Reply via email to