Instant loading sometimes causes 404s on assets (e.g. images)
See original GitHub issueFirst, thank you for the awesome work!
I checked that…
- … the documentation does not mention anything about my problem
- … the problem doesn’t occur with the default MkDocs template
- … the problem is not in any of my customizations (CSS, JS, template)
- … there are no open or closed issues that are related to my problem
Description
I do have pages with several pictures on pages which are in subfolders.
When features instant
is set in mkdocs.yml
, some of the images may not display. In the DevTools console, I see 404 errors in the network tab. I also see the 404 errors in mkdocs
stdout.
Refreshing the page does display the images.
Expected behavior
Images should display without having to refresh.
Actual behavior
Images do not display (not systematically), and getting 404 errors in the DevTools Network tab.
Steps to reproduce the bug
- Have a site structured like this, with instant:
docs/
folder1/
README.md
pic1.png
pic2.png
pic3.png
folder2/
README.md
pic4.png
pic5.png
pic6.png
README.md
- Serve locally
mkdocs serve
- Observe 404 errors
Package versions
- Python:
python --version
: 3.7.5 - MkDocs:
mkdocs --version
; mkdocs, version 1.1 - Material:
pip show mkdocs-material | grep -E ^Version
: version 5.1.1
Project configuration
site_name: "Test"
site_description: "Testing"
theme:
name: material
features:
- tabs
- instant
icon:
logo: material/cloud
repo: fontawesome/brands/github
include_search_page: false
search_index_only: true
plugins:
- search
- awesome-pages:
collapse_single_pages: true
markdown_extensions:
- meta
- admonition
System information
- OS: Windows10, WSL (Linux Subsystem / Ubuntu)
- Browser: reproducible in Chrome, MS Edge, Firefox
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:22 (21 by maintainers)
Top Results From Across the Web
How to Find and Fix 404 Errors - Neil Patel
In this post, I'll cover everything you need to know about 404s, why they are bad for business, how to find them, and...
Read more >How to handle loading of images that may not exist?
So the first thing that you can do to counter the broken image problem is to periodically check all images for sanity. You...
Read more >Prevent 404s on bulk resource requests - Vulcan
404s are a problem, and are sometimes unavoidable, especially when making bulk requests. Here, we attempt to catch them before they happen.
Read more >404 Error on Image Transforms - Craft CMS Stack Exchange
I tried adding generateTransformsBeforePageLoad to general.php . But, I still get a 404 error and the image transforms do not load. – Hellyar....
Read more >I'm getting a 404 (or other 40x errors) for my transformed ...
If you resolve the reason for the error (such as by uploading the missing file for 404 errors) and a URL for a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would love to fix it, if I’d be able to reproduce it. I hope you understand that my spare-time is limited and I cannot invest more time into this topic without a reproducible case. Also, there seem to be very few people suffering from this problem. Maybe, somebody manages to provide a reproducible case in the future but your zip works perfectly for me.
Thanks! I’ll look into it, but, unfortunately, it might take some time. In the meantime, you may disable instant loading.