mkdocs-material: Instant loading sometimes causes 404s on assets (e.g. images)

First, 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

  1. 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
  1. Serve locally mkdocs serve
  2. 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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 22 (21 by maintainers)

Most upvoted 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.