Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with 'collectstatic' in Django 4.2+ and django-mfa2 2.8.0 #80

Closed
camposmoreira opened this issue Dec 27, 2023 · 2 comments
Closed

Comments

@camposmoreira
Copy link
Contributor

I encountered an issue when running python manage.py collectstatic in a Django project with the following configuration:

  • Django: 4.2.7
  • django-mfa2: 2.8.0
  • Staticfiles storage: "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"

Error Message:

ValueError: The file 'mfa/js/qrious.min.js.map' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7fa5f2e5e770>.

Context:
Upon investigation, it seems that the issue is related to changes introduced in Django 4.2, where ManifestStaticFilesStorage now replaces paths to JavaScript source map references with their hashed counterparts. The relevant changelog can be found here.

Observation:
The files mfa/static/mfa/js/bootstrap-toggle.min.js and mfa/static/mfa/js/qrious.min.js are referencing source map files as follows:

//# sourceMappingURL=bootstrap-toggle.min.js.map
//# sourceMappingURL=qrious.min.js.map

Proposal for Solution:
To resolve this issue, I propose adding the missing .map files. The required files can be found at the following locations:

By including these map files in the project, the collectstatic process should complete successfully.

Please let me know if you need any further information or clarification.

@camposmoreira camposmoreira changed the title Subject: Issue with 'collectstatic' in Django 4.2+ and django-mfa2 2.8.0 Issue with 'collectstatic' in Django 4.2+ and django-mfa2 2.8.0 Dec 27, 2023
@mkalioby
Copy link
Owner

Create catch. Can you open a PR with this updates?

Welcome to contributors.

@camposmoreira
Copy link
Contributor Author

Opened a PR (#81) with the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants