Closed btbonval closed 9 years ago
(ps I upgraded django-compressor locally to 1.4; but no improvement)
turning in for the night. Good luck. This one's not cracking easily.
@yourcelf good night, thanks for your help. I would have fumbled around with the wrong project, so you saved me going down the wrong path.
Given the chunk of three CSS files that are causing the missing key error, I noticed that they are all referencing cloudfront. I figured I'd see what's actually there.
http://d2ry5v6uki5dz0.cloudfront.net/static/wysihtml5/toolbar.css is a blank file.
The other two have file contents.
toolbar.css
is empty in the repo.
https://github.com/FinalsClub/karmaworld/blob/note-editing/karmaworld/apps/wysihtml5/static/wysihtml5/toolbar.css
I don't know if it is supposed to be empty, but I'm going to remove it from the {compress}
to see if it fixes the compress error.
This is apparently where the empty file is coming from: {{ note_edit_form.media.css }}
, so I'll comment it out.
https://github.com/FinalsClub/karmaworld/blob/note-editing/karmaworld/templates/notes/note_base.html#L9-L15
woo! moved past that error. new one.
04:54:20 web.1 | OfflineGenerationError: You have offline compression enabled but key "1ea81454b4926d592f670f0172e68ef4" is missing from offline manifest. You may need to run "python manage.py compress". Also forced False and context
04:54:20 web.1 | <script src="//d2ry5v6uki5dz0.cloudfront.net/static/js/setup-ajax.js"></script>
04:54:20 web.1 | <script src="//d2ry5v6uki5dz0.cloudfront.net/static/js/note-detail.js" ></script>
04:54:20 web.1 | <script src="//d2ry5v6uki5dz0.cloudfront.net/static/js/pxem.jQuery.js"></script>
04:54:20 web.1 | <script src="//d2ry5v6uki5dz0.cloudfront.net/static/js/marked.js" ></script>
04:54:20 web.1 | <script src="//d2ry5v6uki5dz0.cloudfront.net/static/js/annotator-full.min.js"></script>
04:54:20 web.1 | <script type="text/javascript" src="//d2ry5v6uki5dz0.cloudfront.net/static/wysihtml5/wysihtml-0.4.17/dist/wysihtml5x-toolbar.min.js"></script>
04:54:20 web.1 | <script type="text/javascript" src="//d2ry5v6uki5dz0.cloudfront.net/static/wysihtml5/wysihtml-0.4.17/parser_rules/advanced_and_extended.js"></script>
04:54:20 web.1 | <script type="text/javascript" src="//d2ry5v6uki5dz0.cloudfront.net/static/wysihtml5/init.js"></script>
04:54:20 web.1 |
not a single empty file in that collection.
All three wysihtml5 includes are coming from {{ note_edit_form.media.js }}
https://github.com/FinalsClub/karmaworld/blob/note-editing/karmaworld/templates/notes/note_base.html#L38
I'll comment that out just to see if I can avoid a 500 error with compress.
Try commenting the CSS out too; it's also handled by compress.
you mean this? https://github.com/FinalsClub/karmaworld/blob/note-editing/karmaworld/templates/notes/note_base.html#L13
I commented that out back in this comment: https://github.com/FinalsClub/karmaworld/issues/397#issuecomment-74811444
yup, that one. :)
Alright commenting out both media includes allows the page to load without a 500 error from compress.
Perhaps we should move those media includes outside of compress so that they are available.
The CSS file was empty, so I could understand why that might cause an issue. The three JS files look alright to me although I didn't look closely.
Alright I pulled those media tags out of the compress tags. They are being included in the source (albeit directly from static and not inside a compress hash file) and the server isn't throwing a 500.
Visiting /note/harvard/reason-and-faith-in-the-west/resumepdf-5-27-43979
, I am seeing an error on the console:
TypeError: m.getComputedStyle(...) is null wysihtml5x-toolbar.min.js:5
I think this is one of the examples @yourcelf had showed me interactively, but with the error, I don't see anything where the note should be. Unsure if that is due to the changes made with how compress works (and thus should stay in this ticket) or if it is worthy of its own ticket.
Alright, I think this issue is long and worked around. No reason to keep it open.
I created a ticket to follow up with django-compressor and wysihtml5. #401
I created a ticket to troubleshoot the wysihtml5 typeerror that doesn't belong in this ticket. #402
While running a local VM, I got an error about some compress key missing and that I needed to run
manage.py compress
. This is a new issue, but it looks like compress has been around for some time.The error might have been because I was running a database dumped from the beta system, but that assumes
compress
uses the database to store stateful information.It sounds like compress is used to glob together js and css files in a tight format. That's great! But I've never run it manually before.
collectstatic
so that compressed static files are actually uploaded? [Yes]collectstatic
so that uncompressed static files are not actually uploaded? [No, all files are uploaded regardless of compress]