Context
We discussed about this bug here and @kamilkrzyskow suggested me to make an issue.
Bug description
If your browser has an invalid values like palette index in cache, the website will fail to load the whole Javascript stuffs.
I made a minimal standalone repository described on Reproduction section, so please have a look.
Related links
Reproduction
I made a repository to reproduce the exactly same thing on this repository. The steps are simple and you can follow and make exactly same .zip files.
Steps to reproduce
The content in this section is copied from this repository's README.md with slight modification.
Bug reproducing repository for mkdocs-material
This repository is used to introduce users to reproduce mkdocs-material bug discussed here.
Steps to reproduce in local
- Clone this repository.
- Make a virtual environment (Python 3.11) for this repository.
- Run
pip install --upgrade --force-reinstall mkdocs-material to install mkdocs-material.
- Checkout to commit ff4d4cf.
- Run
mkdocs serve in your terminal to turn on local server.
- Access
127.0.0.1:8000 from your browser.
- Press button on the website to make palette to the dark mode.
- Checkout to commit a0d3b0b and refresh your build (
mkdocs serve will refresh automatically).
- Enjoy the bug. Javascript stuffs like searching, side navigations wouldn't work.

Steps to reproduce .zip files
Since mkdocs-material encourages people to use .zip files made by info plugin instead of making a repository, I am going to make 2 .zip files.
- Run
echo 2_palettes | mkdocs build -f mkdocs_2_palettes.yml
- Run
echo 3_palettes | mkdocs build -f mkdocs_3_palettes.yml
Proposal to resolve this
I suggest to insert a validation JS code for invalid values in cache.
Browser
Edge
Before submitting
Context
We discussed about this bug here and @kamilkrzyskow suggested me to make an issue.
Bug description
If your browser has an invalid values like palette index in cache, the website will fail to load the whole Javascript stuffs.
I made a minimal standalone repository described on
Reproductionsection, so please have a look.Related links
Reproduction
I made a repository to reproduce the exactly same thing on this repository. The steps are simple and you can follow and make exactly same
.zipfiles.Steps to reproduce
The content in this section is copied from this repository's README.md with slight modification.
Bug reproducing repository for mkdocs-material
This repository is used to introduce users to reproduce
mkdocs-materialbug discussed here.Steps to reproduce in local
pip install --upgrade --force-reinstall mkdocs-materialto installmkdocs-material.mkdocs servein your terminal to turn on local server.127.0.0.1:8000from your browser.mkdocs servewill refresh automatically).Steps to reproduce
.zipfilesSince
mkdocs-materialencourages people to use.zipfiles made byinfoplugin instead of making a repository, I am going to make 2.zipfiles.echo 2_palettes | mkdocs build -f mkdocs_2_palettes.ymlecho 3_palettes | mkdocs build -f mkdocs_3_palettes.ymlProposal to resolve this
I suggest to insert a validation JS code for invalid values in cache.
Browser
Edge
Before submitting