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

Optimize favicon bug #5098

Closed
4 tasks done
uPagge opened this issue Feb 25, 2023 · 9 comments
Closed
4 tasks done

Optimize favicon bug #5098

uPagge opened this issue Feb 25, 2023 · 9 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@uPagge
Copy link

uPagge commented Feb 25, 2023

Context

No response

Bug description

The optimization plugin does not work, it crashes with an error at startup:

WARNING - Config value 'dev_addr': The use of the IP address '0.0.0.0' suggests a production environment or the use of a proxy to connect to the MkDocs server.
However, the MkDocs' server is intended for local development purposes only. Please use a third party production-ready server instead.
INFO - Building documentation...
INFO - Cleaning site directory

Optimizations:
FileNotFoundError: [Errno 2] No such file or directory: '.cache/plugin/optimize/images/assets/images/favicon.png'

Adding favicon to the assets/images/favicon.png folder does not solve the problem.

Only adding an image to '.cache/plugin/optimize/images/assets/images/favicon.png' Fixes this problem, but it's a clear crutch.

Related links

Reproduction

en.zip

Steps to reproduce

It is sufficient to simply run the assembly

Browser

No response

Before submitting

@uPagge
Copy link
Author

uPagge commented Feb 26, 2023

Hmm, it doesn't seem to be about the favicon. It's just that I'm getting an error on any image. I added an image to the article and got

Optimizations:
FileNotFoundError: [Errno 2] No such file or directory: '.cache/plugin/optimize/images/features/notify/notify-new-mr.png'

@squidfunk
Copy link
Owner

Thanks for reporting. I've downloaded and run your example – I see no errors:

INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: /Users/squidfunk/Downloads/en/site

  Optimizations:
    *.png 1.9 kB ↓ 0.0 B [0.0%]

INFO     -  Documentation built in 0.38 seconds

What's missing from your example is necessary additional information that is all collected by the built-in info plugin – installed dependencies, runtime info, etc. Thanks for attaching the reproduction, but it is incomplete without this information.

Thus, without the additional info, we're sadly unable to help you. If you provide a complete reproduction, we can look into it again, but until then, we're closing this issue as not reproducible.

@squidfunk squidfunk added bug Issue reports a bug needs reproduction Issue lacks a minimal reproduction .zip file labels Feb 26, 2023
@yrashk
Copy link
Sponsor

yrashk commented Apr 2, 2023

👍 I am also having this problem, will try to reproduce

yrashk added a commit to yrashk/yrashk.github.io that referenced this issue Apr 3, 2023
Print no gain summary as there is a bug
squidfunk/mkdocs-material#5098
@yrashk
Copy link
Sponsor

yrashk commented Apr 3, 2023

I am not sure about minimal reproduction, but I've traced it down to being triggered during the printing of the gain summary. Disabling it works for now:

plugins:
  - optimize:
         print_gain_summary: false

@squidfunk
Copy link
Owner

@yrashk that is weird – if you could pack up a minimal reproduction, I'd be happy to investigate!

@JuLeeAtPlanet
Copy link

@yrashk 's fix work-around worked for me.

@squidfunk
Copy link
Owner

This should be fixed now, see #5676 (comment). It's likely that pngquant is not installed on the system.

@squidfunk squidfunk added resolved Issue is resolved, yet unreleased if open and removed needs reproduction Issue lacks a minimal reproduction .zip file labels Jul 6, 2023
@squidfunk
Copy link
Owner

Resolved via #5667, see #5676 (comment)

@squidfunk
Copy link
Owner

Released as part of 9.1.18+insiders-4.37.0 – I'm sufficiently confident that this should fix all reported problems, i.e., instruct the user to install pngquant and pillow, if they're not available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

4 participants