Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whitenoise giving errors on jquery-ui.css when doing collectstatic

I'm trying to install the jquery-ui-dist package, and when I run collectstatic, whitenoise seems to have trouble when a url is inside quotations in a stylesheet.

The error I get is:

MissingFileError: The file 'jquery-ui-dist/"images/ui-icons_555555_256x240.png"' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7fb16b7000b8>.

The CSS file 'jquery-ui-dist/jquery-ui.css' references a file which could not be found:
  jquery-ui-dist/"images/ui-icons_555555_256x240.png"

Please check the URL references in this CSS file, particularly any
relative paths which might be pointing to the wrong location.

I see that it seems to think it's looking for a bad filename, as it keeps the quotations around it, and I assumed that the reason was because the source file has url("images/ui-icons_555555_256x240.png") when the quotations are unnecessary, so I ran sed -i 's/\"images\/ui-icons_555555_256x240.png\"/images\/ui-icons_555555_256x240.png/g' jquery-ui.css on the source file, which removed the quotation marks, but I still get the error.

I'm assuming there is a problem with either whitenoise or the jquery-ui-dist package, but until the problem is fixed on their end, I at least need a temporary solution, and I'm not even sure where the actual problem lies.

EDIT:

I found that it is the comments in the css files that are causing the issue. I don't know why whitenoise is parsing comments though, nor do I know what I can do about it other than manually remove those comments.

like image 832
PoDuck Avatar asked Nov 11 '17 14:11

PoDuck


2 Answers

Since nobody else has information on this, I decided I would answer my own question in case people have this problem and don't read my edit.

If you edit the source files to remove comments, it will fix the problem. The problem with this is, each time you update the source files, it will overwrite the edited files, and you will be stuck removing comments again.

To be honest, I have not checked this recently to see if it is still an issue as of the time of this reply, but I assume it still is.

like image 56
PoDuck Avatar answered Nov 13 '22 03:11

PoDuck


I just try to remove all first comment block in all jquery css file, and it works well. Thanks.

like image 1
Riska Kurnianto Avatar answered Nov 13 '22 01:11

Riska Kurnianto