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

New Bootstrap change: sourceMappingURL=bootstrap.min.css.map to be included in latest release? #488

Closed
enoren5 opened this issue Apr 15, 2023 · 7 comments · Fixed by #540
Labels
bug Something isn't working

Comments

@enoren5
Copy link

enoren5 commented Apr 15, 2023

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:

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:

  1. Download / fork the repo and install / build jazzmin manually
  2. 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.

@yvdjee
Copy link

yvdjee commented Aug 23, 2023

pip3 install https://github.com/farridav/django-jazzmin/archive/refs/heads/master.zip

@LouisDelbosc
Copy link

LouisDelbosc commented Sep 7, 2023

I have the same error as @enoren5. Did you fix it ? Did the @yvdjee fix worked ?

edit: it works

@darideveloper
Copy link

I fixed it, but is not the "best way"

Just copy the Jazmin app and remove the wrong lines

  1. go to you venv (or the name of your virtual enviroment) > Lib > site-packages
  2. move "jazzmin" folder to your root folder (it will be like jazzmin was an app created by you)
  3. using vs code (or your code editor) search bar, fin all files with a comment ".min.css.map"
  4. remove all of these comments from the css files (there are just comments who are confussing the django collect static)
  5. 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

@ZanMax
Copy link

ZanMax commented Feb 20, 2024

Any updates? I try to collectstatic and received the same error:
Post-processing 'vendor/bootswatch/default/bootstrap.min.css' failed!

@hughesdai
Copy link

@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.

@jamesgilmorelyst
Copy link

I've raised the relevant PR to release this fix, but don't have permission to merge - #540

@jamesgilmorelyst
Copy link

@enoren5 we've released V2.6.1 of django-jazzmin now which include this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants