﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33900	Support for finding paths in CSS source map comments seems to break manage.py collectstatic when *.map file is missing	Hervé Le Roy	nobody	"{{{
python manage.py collectstatic --noinput
Post-processing 'rest_framework/css/bootstrap.min.css' failed!

Traceback (most recent call last):
  File ""/sandbox/django4.1/mysite/manage.py"", line 22, in <module>
    main()
  File ""/sandbox/django4.1/mysite/manage.py"", line 18, in main
    execute_from_command_line(sys.argv)
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/core/management/__init__.py"", line 446, in execute_from_command_line
    utility.execute()
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/core/management/__init__.py"", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/core/management/base.py"", line 402, in run_from_argv
    self.execute(*args, **cmd_options)
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/core/management/base.py"", line 448, in execute
    output = self.handle(*args, **options)
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py"", line 209, in handle
    collected = self.collect()
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py"", line 154, in collect
    raise processed
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/contrib/staticfiles/storage.py"", line 338, in _post_process
    content = pattern.sub(converter, content)
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/contrib/staticfiles/storage.py"", line 215, in converter
    hashed_url = self._url(
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/contrib/staticfiles/storage.py"", line 152, in _url
    hashed_name = hashed_name_func(*args)
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/contrib/staticfiles/storage.py"", line 388, in _stored_name
    cache_name = self.clean_name(self.hashed_name(name))
  File ""/sandbox/django4.1/venv/lib/python3.10/site-packages/django/contrib/staticfiles/storage.py"", line 113, in hashed_name
    raise ValueError(
ValueError: The file 'rest_framework/css/bootstrap.min.css.map' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7f8a9d025210>.
}}}

**Steps to reproduce the issue**

Install the following packages
{{{
Django==4.1
djangorestframework~=3.13

}}}

Start a new project
{{{
django-admin startproject mysite
}}}

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`

It was working fine with 4.0, so my assumption is that it is related to the newly added ""Support for finding paths in CSS source map comments"".
At first sight, it seems it expects the *.map file to exist, which may not be the case, especially for packages outside of my control.
"	Bug	closed	contrib.staticfiles	4.1	Normal	duplicate	ManifestStaticFilesStorage		Unreviewed	0	0	0	0	0	0
