django-jazzmin
django-jazzmin copied to clipboard
New Bootstrap change: `sourceMappingURL=bootstrap.min.css.map` to be included in latest release?
I’ve got jazzmin installed and running locally - - piece of cake. The developers have done a terrific job making it very simple to get started. But I’m now having an issue deploying to Heroku. Heroku is rejecting my push because the pre-receive hook fails. With Heroku, pre-receive hooks are like a ‘gate’ for receiving pushes: if the hook fails, then the session ends and the push doesn’t land.
In my long traceback, this is where my Heroku build chokes:
remote: whitenoise.storage.MissingFileError: The file 'vendor/bootswatch/default/bootstrap.min.css.map' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f0bf2f350c0>.
remote: The CSS file 'vendor/bootswatch/default/bootstrap.min.css' references a file which could not be found:
remote: vendor/bootswatch/default/bootstrap.min.css.map
remote: Please check the URL references in this CSS file, particularly any
remote: relative paths which might be pointing to the wrong location.
It can’t find: vendor/bootswatch/default/bootstrap.min.css.map
. It appears Heroku is getting thrown off by the fact that this file ends with a strange .map extension - - it simply doesn’t exist.
In my source code, there is no instance of vendor
or bootswatch
. It’s not in either of my static folders and there is no jazzmin web app directory either. So I found the jazzmin source code here on GitHub and located the vendor
bootswatch
CSS file. Here it is on the master branch:
- https://github.com/farridav/django-jazzmin/blob/master/jazzmin/static/vendor/bootswatch/default/bootstrap.min.css
At that location, if you click the latest commit (dated as recently as January 26, 2023), all the way at the bottom of the file the line which I think might be relevant is commented out which references the bootstrap css file location in the source. The commented out line reads:
/*# sourceMappingURL=bootstrap.min.css.map */
It’s merged in master
at the end of January but the latest version of the jazzmin package I have installed is v2.6.0 whose timestamp on GitHub shows November 3, 2022. What this means is that the key line and change in the CSS file which "might" solve my problem is newer than the out of date package I have installed.
Since I can’t modify that css file locally with the way jazzmin is currently installed, I suppose there are two solutions that I can try:
- Download / fork the repo and install / build jazzmin manually
- Ask the project owner on GitHub to create a point release and then ask the maintainer on pypi.org to build and distribute the latest release.
I am leaning towards option 1 because this is something I can do myself rather than waiting on other people to do it for me (option 2).
I’d like to try my hand at installing jazzmin manually but the instructions in the README.md
only show how to install one way: $ pip install django-jazzmin
.
If I want to install jazzmin from source so that I am using the latest changes on master
, what would be my next step?
I went searching on Google for :
- ‘ install jazzmin manually ‘
- ‘ install jazzmin from source ‘
Nothing relevant came up.
pip3 install https://github.com/farridav/django-jazzmin/archive/refs/heads/master.zip
I have the same error as @enoren5. Did you fix it ? Did the @yvdjee fix worked ?
edit: it works
I fixed it, but is not the "best way"
Just copy the Jazmin app and remove the wrong lines
- go to you venv (or the name of your virtual enviroment) > Lib > site-packages
- move "jazzmin" folder to your root folder (it will be like jazzmin was an app created by you)
- using vs code (or your code editor) search bar, fin all files with a comment ".min.css.map"
- remove all of these comments from the css files (there are just comments who are confussing the django collect static)
- remove jazzmin from your requirements
Thats all. May be, in the following weeks, I would fork it to fix in a easier way
for me, now is working in heroku
Any updates? I try to collectstatic and received the same error:
Post-processing 'vendor/bootswatch/default/bootstrap.min.css' failed!
@ZanMax find the file that throws an error, scroll to bottom, there is a comment at the bottom "/*# sourceMappingURL=bootstrap.min.css.map */". Deleting this comment, made mine work.
I've raised the relevant PR to release this fix, but don't have permission to merge - https://github.com/farridav/django-jazzmin/pull/540
@enoren5 we've released V2.6.1 of django-jazzmin now which include this fix.